delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT sources DOT redhat DOT com |
Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
Message-Id: | <4.3.1.2.20001122095115.020b2e78@pop.ma.ultranet.com> |
X-Sender: | lhall AT pop DOT ma DOT ultranet DOT com |
X-Mailer: | QUALCOMM Windows Eudora Version 4.3.1 |
Date: | Wed, 22 Nov 2000 09:59:51 -0500 |
To: | schwarza AT gdls DOT com, cygwin AT cygwin DOT com |
From: | "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com> |
Subject: | Re: newbie: Out of order execution in script |
In-Reply-To: | <OF55351BB1.F6C3281B-ON8525699E.007D5DBE@gdls.com> |
Mime-Version: | 1.0 |
At 05:57 PM 11/21/2000, schwarza AT gdls DOT com wrote: >I'm using the latest 'stable' version of cygwin (1.1.5) on a Win95 platform >It looks like a script was executed after the statement following the >script started - out of order execution. Is this possible? > >In a script I execute: > >importScript=<path>/import.sh >importMain=<filename> >tmp=/tmp/$$.gnatmake >gnatI=${tmp}/gnatI >outImp=${tmp}/<filename> > >${importScript} ${importMain} ${tmp} > >sed -e '/(/d' \ > -e 's@/kostabi@@' \ > -e 's@^@\ -aI/kostabi@' \ > -e 's@/@\\@g' ${outImp}.imp > ${gnatI} > >The messages below are: > >[1] sed: can't read /tmp/398883.gnatmake/device_control_main.imp: No such >file or directory > >[2] Main file: device_control_main > >which come in the exact order shown. > >The issue is that message [2] is output by the ${importScript} line, and >message [1] indicates that the script has not executed. > >In looking at ${tmp} I do see a successful generation of the output file >(${outImp}.imp) indicating that the statement before the 'sed' was run >successfully. I'm guessing that the 'sed' was executed before the script >was started, and failed because the output file was not generated. This >script ran successfully under cywin-b20.1 and I don't see what I'm doing >wrong. > >Any idea what I did? You used Windows 95 (I wish I were kidding!) I've noted in the past that there can be a noticeable lag between when a file is created and when it registers in the filesystem. You can see this lag by running some program (like touch) which creates a file. If you watch the directory where the file will be created in the Explorer, you will notice there is some lag between when you issue the command and when it appears. This is NOT just an artifact of the GUI/Explorer but a real delay. If you ask for the existence of the file before it shows up in the Explorer, you will find that the file is not found. The solution? Your best bet is to get a better (Windows) O/S. I haven't checked to see whether this issue persists on later 9x versions. It doesn't happen on NT versions. Alternatively, you're left with the option of implementing work-arounds that poll to see if the file you know was just created actually exists and to "wait" until it actually shows up. This was the only way I found to guarantee I would get what I expect. YMMV. Larry Hall lhall AT rfk DOT com RFK Partners, Inc. http://www.rfk.com 118 Washington Street (508) 893-9779 - RFK Office Holliston, MA 01746 (508) 893-9889 - FAX -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |