how can I compare two files(their size and date modified)?Is it posible?
comparing files
Collapse
X
-
Originally posted by heirohow can I compare two files(their size and date modified)?Is it posible?
>>> os.path.getsize (fn)
10424L
>>> os.path.getmtim e(fn)
1200398316
>>> [/code] -
Originally posted by bvdetYou can use the os module to determine the file size in bytes and the time of last modification as the number of second since the epoch.[code=Python]fn = 'file_name'
>>> os.path.getsize (fn)
10424L
>>> os.path.getmtim e(fn)
1200398316
>>> [/code]
thanks for that. But when i get the size of folder it will return 0byte.How can solve this?Comment
Comment