I am using python on embedded device which is running linux 2.6.32.
Using python to fetch the file size as os.path.getsize() returns me a negative value.
I refered to one of the similar questions here on stack overflow and tried recompiling python with CFLAGS='-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' OPT="-g -O2 $CFLAGS"
but still it returns negative file size.
I am using python 2.6.4 with Django 1.2.4 on linux 2.6.32.
Can any one tell me where the problem is?
Clearly, something is wrong with your Linux distribution’s build of Python. Rather than fix the actual problem, it might be easier to just work around it: