J
John Hunter
I am a bit confused about LFS in python. In the olden days, I used
the following to test whether python and my kernel supported large
files
0L
If 0L was returned, LFS was enabled, if 0 was returned, LFS was not
enabled.
I built python with LFS
499 CFLAGS='-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' OPT="-g -O2 $CFLAGS" ./configure
501 make
502 make install
But fd.tell() returned 0. I wrote a little script to create a large
file >4GB
[root@crcdocs tmp]# cat lfs_write.py
fd = file('test2.dat', 'w')
SIZE = 4096
STOP = 2**32
total = 0
s = 'a'*SIZE
while total<STOP:
fd.write(s)
total += SIZE
print total
print fd.tell()
and it ran without incident, reporting at the end 4294967296 (no L).
So I can at least write files past the 2GB limit (and I wrote a script
to verify that I could read the who file too).
I am installing a zope server and will need to create a Data.fs that
exceeds the 2GB limit.
Is the fd.tell() 0L trick no longer valid. What is the right way to
test for LFS support in python?
JDH
the following to test whether python and my kernel supported large
files
0L
If 0L was returned, LFS was enabled, if 0 was returned, LFS was not
enabled.
I built python with LFS
499 CFLAGS='-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' OPT="-g -O2 $CFLAGS" ./configure
501 make
502 make install
But fd.tell() returned 0. I wrote a little script to create a large
file >4GB
[root@crcdocs tmp]# cat lfs_write.py
fd = file('test2.dat', 'w')
SIZE = 4096
STOP = 2**32
total = 0
s = 'a'*SIZE
while total<STOP:
fd.write(s)
total += SIZE
print total
print fd.tell()
and it ran without incident, reporting at the end 4294967296 (no L).
So I can at least write files past the 2GB limit (and I wrote a script
to verify that I could read the who file too).
I am installing a zope server and will need to create a Data.fs that
exceeds the 2GB limit.
Is the fd.tell() 0L trick no longer valid. What is the right way to
test for LFS support in python?
JDH