Subject: Re: cp problem on Win95 / lseek past EOF
From: [email-masked] (Vince Del Vecchio)

24 Jul 1997 16:51:47 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-Sender: [email-masked]

Someone else complained about cp.exe not working on Win95, and
I am also having problems.  My problem appears to be that Win95
does not deal properly with "holey" files.  When GNU cp finds a
block of zeros in the input, by default it lseek()s past that
section in the output instead of writing it.  It seems that
on Win95 this doesn't zero the unwritten section, but leaves
garbage in it.  It seems to me the library needs to deal with
this behavior by actually writing the zeros.

I was trying to find out whether the behavior of the relevant
Win32 calls (SetFilePosition and WriteFile, specifically)
was defined, but it doesn't seem to be documented.  Does NT have
to follow the Unix behavior because of POSIX?  In any case, cp
seemed to work on NT, although the little test program I wrote
(which did write/lseek/write/lseek-to-hole/read) still failed.

-Vince Del Vecchio
[email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".