cygwin-1.5.0-1: Problem stat-ing big file
Markus Schönhaber
mks99@t-online.de
Thu Jul 10 11:50:00 GMT 2003
While trying if the new support for files larger than 2GB works, I
created a file with a size of 4.53 GB (4,869,120,000 Bytes) using a
simple write in python. No problems here. But when stat-ing the file
with python's os.stat or by calling stat from C as done in the little
program below, the size of the file gets reported as 574,152,704 Bytes.
#include <stdio.h>
#include <sys/stat.h>
int main(int argc, char** argv)
{
struct stat s;
stat(argv[1], &s);
printf("Size of file <%s>: %ld", argv[1], s.st_size);
return 0;
}
What I also found interesting is the output of ls. While the size
reported next to the file (big.bin) is wrong, the total seems reasonable:
$ /bin/ls -l /cygdrive/c
total 4755283
-rwxrwx---+ 1 Administ SYSTEM 0 Jun 19 17:43 AUTOEXEC.BAT
-rwxrwx---+ 1 Administ SYSTEM 0 Jun 19 17:43 CONFIG.SYS
drwxrwxr-x+ 9 Administ SYSTEM 0 Jul 9 09:15 Dokumente und
Einstellungen
-r-xr-x---+ 1 Administ SYSTEM 0 Jun 19 17:43 IO.SYS
drwx------+ 6 mks Kein 0 Jun 20 02:57 Inetpub
-r-xr-x---+ 1 Administ SYSTEM 0 Jun 19 17:43 MSDOS.SYS
-r-xr-x---+ 1 Administ SYSTEM 47580 Jun 19 17:56 NTDETECT.COM
dr-xr-x---+ 29 Administ SYSTEM 0 Jul 9 23:28 Programme
drwx------+ 3 mks Kein 0 Jun 19 19:13 RECYCLER
d---rwx--- 2 Administ SYSTEM 0 Jun 19 17:47 System Volume
Information
drwxrwx---+ 68 Administ SYSTEM 0 Jul 10 00:08 WINDOWS
-rw-r--r-- 1 mks Kein 574152704 Jul 10 13:09 big.bin
-rwxrwx---+ 1 Administ SYSTEM 194 Jun 19 17:34 boot.ini
-r-xr-x---+ 1 Administ SYSTEM 4952 Aug 23 2001 bootfont.bin
-r-xr-x---+ 1 Administ SYSTEM 235296 Jun 19 17:56 ntldr
Regards
mks
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20030710/1faff186/attachment.txt>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list