emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file sizes shown incorrectly for large files under Windows


From: Eli Zaretskii
Subject: Re: file sizes shown incorrectly for large files under Windows
Date: 12 Nov 2003 08:45:19 +0200

> Date: 11 Nov 2003 02:10:07 +0100
> From: Chris Moore <address@hidden>
> 
> Using an eshell buffer I see the same information:
> 
>   h:/ $ ls -l *.dim
>   -rw-rw-rw-   1 Chris    5        386551808 Aug 22 06:38 Disk Image (C).DIM
> 
> The native Windows dir command shows me the correct size:
> 
>   22/08/2003  06:38    26,156,355,584 Disk Image (C).DIM

That's a 26-Gbyte file.

> It seems that both problems stem from the use of the file-attributes
> function:
> 
>   (nth 7 (file-attributes "Disk Image (C).DIM"))
>   => 386551808.0
> 
> file-attributes uses a floating point value for the filesize because
> it's too big to be stored in an integer, but it still gets it wrong.

I'd suspect a bug in the Windows implementation of `stat': it might
not support files larger than 2GB (or maybe 4GB).  Could you please
show us the declaration of `struct stat' used by the Windows port?
The interesting part is the declaration of the `st_size' member of
`struct stat'.  You should be able to find that on the sys/stat.h
header.

(The DIR command could use native Windows syscalls, which don't have
the 2GB limitation, which would explain why it works while Emacs
doesn't.)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]