delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/14/07:56:24

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
Subject: Create file on remote node, immediate test-r fails intermittently
To: cygwin AT sources DOT redhat DOT com
X-Mailer: Lotus Notes Release 5.0.2a November 23, 1999
Message-ID: <OF9B1DC7B8.F31C4D09-ON80256A6B.003774DA@meridian-vat.com>
From: Richard_Senior AT meridian-vat DOT com
Date: Thu, 14 Jun 2001 12:57:48 +0100
X-MIMETrack: Serialize by Router on mail01/Europe/PRG(Release 5.0.5 |September 22, 2000) at
06/14/2001 12:57:51 PM
MIME-Version: 1.0

I'm working as a consultant in a client that is moving a large Oracle
application from Unix to Windows 2000. I have been using Cygwin and Bash to
provide an environment to run some of their legacy shell scripts. To date
this approach has been very effective (well done to all involved with
Cygwin!) and I have been able make most of the scripts work with only
slight modifications.

However, in the last couple of days a colleague of mine has run into an
issue with a shell script that automates conversion of scanned documents
from TIF to GIF. Sometimes (< 10%) the script does not see the GIF file it
has just created.

We have simulated the structure of the script in this test case:

ERROR_FOUND=false
if test -r test1.dat; then
  echo "File test1.dat already exists"
else
  # Simulate the image conversion - a short delay then write output file
  sleep 1; touch test1.dat
  if test -r test1.dat; then
    echo "File test1.dat created"
  else
    echo "***ERROR*** Can not create file test1.dat"
    ERROR_FOUND=true
  fi
fi
if [ $ERROR_FOUND = false ]; then
  # Simulate the submission of a report to run in background
  # Remove the & and the script works!
  sleep 1; echo "OK" &
fi

... and so on for test2.dat, test3.dat, etc.; about 50-100 instances.

Obviously this should not, in normal circumstances, generate the
***ERROR*** message. However, we are finding that it does produce the
message intermittently (< 10%), even though the files are created.

The if statement at the end might look odd but it mimics the running of a
report in background after conversion of the image. This takes a short time
to submit, hence the sleep 1, and runs in the background. Curiously, if we
take the '&' off the echo command (or the report in the real version), the
script works as expected.

We have Cygwin DLL v1.1.7. The script behaves the same on NT4 and Windows
2000. Any ideas? I don't have access to a Linux box here but I will try it
when I get back home tonight -- I am assuming it is only an issue with
Cygwin/Windows. The full test case script can be downloaded from
http://www.r-senior.demon.co.uk/test.sh.

I think we can work round the problem but it would be great to have an
answer to maintain the client's confidence in Cygwin.

TIA

Richard Senior
Mill Dam Consulting Ltd, London
richard DOT senior AT milldam DOT com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019