filesize issue

Fairlight fairlite at fairlite.com
Tue Oct 4 17:17:57 PDT 2011


On Tue, Oct 04, 2011 at 07:00:15PM -0400, Ed Hilovsky may or may not have
proven themselves an utter git by pronouncing:
> Two files:
> 
>  
> 
> -rwxrwxr-x  1 filepro users    0 Oct  3 12:13 10002038.csv
> 
> -rwxrwxr-x  1 filepro users 3522 Oct  3 12:14 10002039.csv
> 
> 
>        Then: aa=filesize(csvfile)
>  
> 
> How could I tell when a file is zero length ? ( ie 10002038.csv)

You need to do something like:

fh=open(csvfile,"r")
aa=filesize(fh)

filesize() takes a handle, not a path.

mark->
-- 
Fairlight->   ||| "Get on your hands and knees and   | Fairlight Consulting
  __/\__      ||| serve the new diety / Serve the    | http://www.fairlite.com
 <__<>__>     ||| ego..." --Jewel                    | fairlite at fairlite.com
    \/        |||                                    | (502) 509-3840


More information about the Filepro-list mailing list