File size limitations

Mark Hammond mhammond at skippinet.com.au
Fri Feb 4 18:32:06 EST 2000


If you use the win32api module you can get access to 64 bits of file
size - albiet in an ugly way.  win32api.FindFiles has the high and low
32 bits of the file size - you need to perform the magic to turn these
2 values into a single Python long yourself.

If you use the win32file module, the function win32file.GetFileSize()
should return the file size correctly for huge files - an int object
in the < 2^32 case, and a long object for larger files.

Mark.

<gmc333 at my-deja.com> wrote in message
news:87cql2$t8j$1 at nnrp1.deja.com...
> I'd like to use Python for some large-scale file processing on
Windows
> NT. There is a possibility that the size of the files I'll be
working
> with will exceed 2^32 bytes.
>
> Can Python handle files that large? Random I/O is a specific
concern,
> since an implementation based on fseek/lseek system calls will fail
> (these calls use 32-bit math, and bad things can happen with seeks
that
> go too far).
>
> Thanks!
>
> Greg
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





More information about the Python-list mailing list