[Tutor] [HELP]how to test properties of a file

Shidai Liu shidai.liu at gmail.com
Tue Apr 5 01:19:19 CEST 2005


On Apr 4, 2005 10:43 PM, Alan Gauld <alan.gauld at freenet.co.uk> wrote:
> 
> Its not really the simplest, its not efficient and it might be
> dangerous
> if the file is not empty. At the very least open using 'a' to avoid
> obliterating the file!!
> 
> However the os.stat function and stat module do what you want safely
> and more comprehensively:
> ... 
> ...

Thanks a lot, Alan. This is new to me.
-- 
With best wishes!
Shidai


More information about the Tutor mailing list