This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Interesting observation with sparse files


Hi,

just FYI, I found the following weird behaviour on XP.  I tried to create
two sparse files with random values:

$ createsparse sparse.1 123456789K
$ createsparse sparse.2 1234567890K

The first call worked, the second call failed and the resulting file
was of size 4K.

createsparse works like this:

  seek = strtoll(argv(2));
  fd = open(file);
  write(fd, buf, 4096);
  lseek(fd, seek, SEEK_CUR);
  write(fd, buf, 4096);
  close(fd);

An strace revealed the following:

  off_low = 1477138432;
  off_high = 294;
  SetFilePointer(get_handle (), off_low, &off_high, FILE_CURRENT);

returned with no error.  But the following WriteFile() returned with
GetLastError() set to 1450:

$ net helpmsg 1450

Insufficient system resources exist to complete the requested service.

Huh?

I have no explanation so far, Microsoft KB doesn't know anything about
this effect.  Note that already the first case creates a file which is
bigger than the partition and even the disk I try to create it on.  Also
removing that file before creating the second one doesn't change anything.


Weird,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]