Source From Here
Question
I want to do something based on the file size. For example, if the size is greater than 0, I will send an email to somebody, otherwise continue to other things. How do I check the file size?
How-To
Use os.stat, and use the st_size (Size in bytes of a plain file; amount of data waiting on some special files.) member of the resulting object:
Question
I want to do something based on the file size. For example, if the size is greater than 0, I will send an email to somebody, otherwise continue to other things. How do I check the file size?
How-To
Use os.stat, and use the st_size (Size in bytes of a plain file; amount of data waiting on some special files.) member of the resulting object:
沒有留言:
張貼留言