Reliable old script loses data on new Cygwin installation

Thomas Baker
Tue Nov 13 17:06:00 GMT 2007

On Mon, Nov 12, 2007 at 04:03:14AM -0600, René Berber wrote:
> [snip]
> > However, the other problem (see below) has occurred --
> > sporadically -- on three different machines, all running
> > German or English-language versions of XP, two with SATA
> > disks and one with an ATA disk, all with freshly downloaded
> > installations of cygwin.[snip]
> OK, that's interesting, 3 machines one using non SATA disk.  Same
> irregular pattern of 10 to 20 runs without problem?

I haven't run it enough to see clear patterns, but yes,
the error occurs in an irregular manner.  Since then I have
tested this on a fourth machine -- my old machine, with newly
installed XP and freshly downloaded Cywin but a slower hard
disk -- and I get the same irregular errors there too!

> No.  The actual storage of data is done by the operating system, not by
> Cygwin, the operating system provides the data even if it hasn't been
> stored on disk (it could still be in a memory buffer).

Okay, thank you for the explanation.

> The speed is not the problem, it could be the usual suspect: an
> anti-virus, unlikely because the data written is not executable but it
> could be adding an extraneous delay between data written and data read.

I'll ask the guy who installed the operating systems whether this
looks possible.

> The only solid evidence is the error message from Windows, and it says
> "device", that means that the hard disk is having problems (it could be
> the driver) but not your script or any program.  Did you do anything
> special to the hard disks on all 3 machines? something like run an
> optimizer or tune parameters?

I'll find out.

> The other problem could be related to the first, if the disk is
> "failing" then creating/moving a file will fail, I'm not sure if
> "permission denied" will be the error message but I could test that
> later (I can make my SATA disk fail using a program that allows the
> async unbuffered I/O).

The /bin/pdksh script sequence that is causing problems is:

   1. gawk '$1 !~ /blahblah/' huh2 >|/tmp/shf2080.tmp
      (no error messages)

   2. mv /tmp/shf2080.tmp huh2
      mv: cannot create regular file `huh2': Permission denied

   3. (some other commands in a looping construct)

   4. gawk '$1 !~ /blahblah/' huh2 >|/tmp/shf2080.tmp
      gawk: cmd. line:1: fatal: cannot open file `huh2' for reading (No such file or directory)

Sometimes the sequence runs correct.  Sometimes it results in a
file "huh2" with length "0".  But the sequence has _sometimes_
resulted in the creation of files such as:

   - 2007-10-28  20:31       4010  german

which _appear_ to have a length of 4010, but where "od german"

    0000000 000000 000000 000000 000000 000000 000000 000000 000000
    0007640 000000 000000 000000 000000 000000

I'll get answers to the questions above...

Tom Baker

Tom Baker - -

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list