delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/24/16:51:47

From: vince DOT delvecchio AT analog DOT com (Vince Del Vecchio)
Subject: Re: cp problem on Win95 / lseek past EOF
24 Jul 1997 16:51:47 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199707242104.RAA06839.cygnus.gnu-win32@dejavu.spd.analog.com>
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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
vince DOT delvecchio AT analog DOT com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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