File Size Mystery??

brobbins333 at shaw.ca brobbins333 at shaw.ca
Thu Apr 11 21:18:56 EDT 2002


this is foofile.txt (created in Windows Notepad):
ur75ht8495u7475ht89302oskv476830rj

and here is what Python tells me about it:


>>> print os.path.getsize('foofile.txt')
34
>>> print len('foofile.txt')
11


os.path.getsize() returns the correct size of the file, 
but len() does not. Why is there a discrepancy?


Bruce Robbins
Victoria, BC
Canada





More information about the Python-list mailing list