<?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: Files on network in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35153#M20738</link>
    <description>&lt;P&gt;ok, then you might want to use a system command to check if the network connection is available and call it before you execute the rest of the script. Not sure if that would last less time though. Some ideas are written in the post I mentioned before.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2017 18:04:42 GMT</pubDate>
    <dc:creator>martindemel</dc:creator>
    <dc:date>2017-01-31T18:04:42Z</dc:date>
    <item>
      <title>Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35062#M20689</link>
      <description>&lt;P&gt;Hello, I have a script which&amp;nbsp;opens a certain file on a network address.&amp;nbsp; When the computer is connected to that network, everything is ok. But when the computer is offline, I'd like the script to halt gently, instead of waiting and waiting before it understands the address is not available. Is there a function to check quickly the remote&amp;nbsp;file availability or even better the network connection availability?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
      <pubDate>Sat, 28 Jan 2017 18:07:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35062#M20689</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2017-01-28T18:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35145#M20732</link>
      <description>&lt;P&gt;Hi Matteo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have you tried the TRY and/or the THORW function. They can catch if you cannot find the file and jump out. Not sure if this solves the issue you described as it probably will search for the path as well. However, worth a try if you haven't checked that so far.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 17:07:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35145#M20732</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2017-01-31T17:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35148#M20734</link>
      <description>&lt;P&gt;e.g. similar to the following command, this will throw an exception message or number if it fails. Then you can do something else (message, alternative file, ...). You may also find other tips in this thread:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Can-JMP-call-a-DOS-Exe/td-p/689" target="_self"&gt;Can-JMP-call-a-DOS-Exe&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = Try( Open( networkpath ),0 )&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jan 2017 17:21:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35148#M20734</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2017-01-31T17:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35149#M20735</link>
      <description>&lt;P&gt;thanks Martin. Yes I'm using "try", but when I'm not connected to the network it takes about 10seconds before exiting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 17:22:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35149#M20735</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2017-01-31T17:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35153#M20738</link>
      <description>&lt;P&gt;ok, then you might want to use a system command to check if the network connection is available and call it before you execute the rest of the script. Not sure if that would last less time though. Some ideas are written in the post I mentioned before.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 18:04:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35153#M20738</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2017-01-31T18:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35156#M20740</link>
      <description>&lt;P&gt;this script uses ping to get an echo back from a server; the text from ping might be a little different on various OS flavors and the test for "Received = 1" might need adjusting. n=1 means only ping once, w=100 means don't wait more than 100ms. &amp;nbsp;The mac version will be different, this is (barely) tested on windows.&lt;/P&gt;
&lt;P&gt;Ping is named after the sound submarine sonars make...then listen for the echo. But unlike a real echo, other delays are possible with busy computers. Your ping might easily pass through five or more computers, and the echo will be similar. &amp;nbsp;You can play with ping in a "dos box" like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Using ping in a &amp;quot;dos box&amp;quot;" style="width: 690px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/4976iFB0805B454C369CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="ping.png" alt="Using ping in a &amp;quot;dos box&amp;quot;" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Using ping in a "dos box"&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;   
isAvailable = Function( {resource},
	{default local},
	Contains( RunProgram( executable( "ping" ), options( {"-n 1 -w 100", resource} ), readfunction( "text" ) ), "Received = 1" ) != 0
);

// this succeeds in &amp;lt; .1 second
start = Tick Seconds();
jmp = isAvailable( "jmp.com" );
stop = Tick Seconds();
Show( jmp, stop - start );

// this fails in about 3 seconds
start = Tick Seconds();
fileserver = isAvailable( "jmpsserver" ); // leave out the back slashes and use the first name
stop = Tick Seconds();
Show( fileserver, stop - start );

// this fails in about .2 seconds
start = Tick Seconds();
nonesuch = isAvailable( "x" || Char( Random Integer( 1e15, 9e15 ) ) || ".com" );
stop = Tick Seconds();
Show( nonesuch, stop - start );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;jmp = 1; -- jmp.com works&lt;BR /&gt;stop - start = 0.0333333333255723;&lt;BR /&gt;fileserver = 0; -- that isn't our file server name&lt;BR /&gt;stop - start = 2.26666666672099;&lt;BR /&gt;nonesuch = 0; -- that isn't likely to be a real web name&lt;BR /&gt;stop - start = 0.0500000000465661;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 18:53:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35156#M20740</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-31T18:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35160#M20744</link>
      <description>&lt;P&gt;Thanks, I will explore this possibility. Actually my resource is&amp;nbsp;a file on a&amp;nbsp;network disk, so ping is not exactly the command I need to use, but the concept of calling a OS command is clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 19:57:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35160#M20744</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2017-01-31T19:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35161#M20745</link>
      <description>&lt;P&gt;try ping with the network disk; that is the middle example. I can't test it completely without asking someone to turn a drive off...&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2017 20:01:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35161#M20745</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-31T20:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35170#M20751</link>
      <description>&lt;P&gt;Perhaps try checking the presence of the file using &lt;STRONG&gt;File Exists&lt;/STRONG&gt; before trying to open it?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 08:46:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35170#M20751</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2017-02-01T08:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Files on network</title>
      <link>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35182#M20761</link>
      <description>&lt;P&gt;Hi Dave, I tried it but it still takes many seconds if resource is not available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Matteo&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 21:01:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Files-on-network/m-p/35182#M20761</guid>
      <dc:creator>matteo_patelmo</dc:creator>
      <dc:date>2017-02-01T21:01:56Z</dc:date>
    </item>
  </channel>
</rss>

