Re: getting file size

2005-01-23 Thread John Machin
Tim Roberts wrote: > 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

Re: getting file size

2005-01-23 Thread John Machin
Tim Roberts wrote: > 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

Re: getting file size

2005-01-22 Thread Tim Roberts
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

Re: getting file size

2005-01-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Bob Smith 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 r

Re: getting file size

2005-01-21 Thread John Machin
Bob Smith 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,

getting file size

2005-01-21 Thread Bob Smith
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 o