<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Gracefully terminate Run Program() in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Gracefully-terminate-Run-Program/m-p/190678#M40951</link>
    <description>&lt;P&gt;Thanks for the idea&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;! I had tried the &amp;lt;&amp;lt;write "bye" before, but without the &amp;lt;&amp;lt;writeEoF ... so perhaps that would make a difference. I had thought of other FTP clients, but this script would be used across a larger user base on which I can't control the FTP client piece.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I find a solid thing that works, I'll post it here, but I'll def try some of your ideas!&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2019 16:48:45 GMT</pubDate>
    <dc:creator>nathan-clark</dc:creator>
    <dc:date>2019-04-01T16:48:45Z</dc:date>
    <item>
      <title>Gracefully terminate Run Program()</title>
      <link>https://community.jmp.com/t5/Discussions/Gracefully-terminate-Run-Program/m-p/190225#M40902</link>
      <description>&lt;P&gt;I am in a situation where I use Run Program() to send files to an FTP/MTP site. By and large everything works great, but sometimes there's a kink in the connection and the program lags indefinitely. I have recreated this problem from the command line and it's basically a lost connection type event. But I need to Ctrl-break out of CMD to stop it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In JMP I want to put in a timeout to reduce the risks, however I haven't been able to get one to work well. Currently I build the timeout into the While(!(x &amp;lt;&amp;lt; isReadEof), Wait(0.1)) command such that x is set to 0, breaking the Run Program. But when I do this JMP will often freeze for a short or longer time to fix (or while something else is fixed) background stuff that had been going on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to force close Run Program() as well as the process it invoked w/o risk to freezing JMP?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 14:32:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Gracefully-terminate-Run-Program/m-p/190225#M40902</guid>
      <dc:creator>nathan-clark</dc:creator>
      <dc:date>2019-03-29T14:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Gracefully terminate Run Program()</title>
      <link>https://community.jmp.com/t5/Discussions/Gracefully-terminate-Run-Program/m-p/190457#M40906</link>
      <description>&lt;P&gt;Try rp&lt;STRONG&gt;&amp;lt;&amp;lt;write&lt;/STRONG&gt; the appropriate quit or exit commands to the FTP program, followed by rp&lt;STRONG&gt;&amp;lt;&amp;lt;writeEOF&lt;/STRONG&gt;. (Although, as you say, the FTP program appears to ignore everything while the connection lost is hanging.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the JMP variable holding the RunProgram object (rp in my examples) is overwritten or destroyed by JMP ending, it will wait for the ftp program to finish. I don't think there is a way to send the ctrl-break through the FTP stdin.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the lost connection hang may last as long as 10 minutes by default and may be configurable; I'm not sure whether that would be in the FTP program or in a windows registry setting. For my test it seemed to hang about 1 minute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All my experiments were done with the builtin windows FTP client. There are probably other clients that might have different features.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 21:08:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Gracefully-terminate-Run-Program/m-p/190457#M40906</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-03-29T21:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Gracefully terminate Run Program()</title>
      <link>https://community.jmp.com/t5/Discussions/Gracefully-terminate-Run-Program/m-p/190678#M40951</link>
      <description>&lt;P&gt;Thanks for the idea&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;! I had tried the &amp;lt;&amp;lt;write "bye" before, but without the &amp;lt;&amp;lt;writeEoF ... so perhaps that would make a difference. I had thought of other FTP clients, but this script would be used across a larger user base on which I can't control the FTP client piece.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I find a solid thing that works, I'll post it here, but I'll def try some of your ideas!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 16:48:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Gracefully-terminate-Run-Program/m-p/190678#M40951</guid>
      <dc:creator>nathan-clark</dc:creator>
      <dc:date>2019-04-01T16:48:45Z</dc:date>
    </item>
  </channel>
</rss>

