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: Thu, 13 Nov 2003 22:18:37 +0200

> Date: Thu, 13 Nov 2003 16:36:09 +0000
> From: Jason Rumney <address@hidden>
> 
> I am not sure that it is a good idea to modify 'struct stat' at all now 
> that I have thought about it. It is likely to introduce other bugs

Could you elaborate?  What kind of bugs did you have in mind?

> the 'long long' type that would have to be used is not compatible 
> between different compilers.

Is there a 64-bit type we could use that _is_ portable?

> I am also not sure that this "bug" is confined to Windows, and any
> Windows specific redefinition would not solve the problem on other
> platforms.

AFAIK, on other platforms, either `stat' supports 64-bit sizes or you
need a 64-bit build for that.

If we want a more general solution, let's define a `struct emacs_stat'
and a wrapper around `stat' that fills it.  Personally, I don't think
this is justified: this problem _is_ Windows-specific because Windows
system calls support 64-bit sizes, but its `struct stat' does not.

> Perhaps a better fix is for the Windows definition of stat() in w32.c to 
> check nFileSizeLow, and set buf->st_size to ULONG_MAX when it is 
> non-zero, so that files larger than 4Gb appear as 4Gb in directory 
> listings instead of wrapping.

That will only solve the problem for files up to 4GB.  The 26GB file
that started this thread will still have a wrong size inside Emacs.




reply via email to

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