Bob Smith <[EMAIL PROTECTED]> wrote: >Are these the same: > >1. f_size = os.path.getsize(file_name) > >2. fp1 = file(file_name, 'r') > data = fp1.readlines() > last_byte = fp1.tell() > >I always get the same value when doing 1. or 2. Is there a reason I >should do both? When reading to the end of a file, won't tell() be just >as accurate as os.path.getsize()?
On Windows, those two are not equivalent. Besides the newline conversion done by reading text files, the solution in 2. will stop as soon as it sees a ctrl-Z. If you used 'rb', you'd be much closer. -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list