Python: directory statistics

45 pts.
Tags:
Object-oriented programming languages
Programming Languages
Python
Python scripts
Scripting
I'm working on a python cleanup script. I'm trying to determine the amount of files and total space prior to the cleanup. Also, want the total files and space of files that are deleted by the script. is os.path.getsize(filePath the way to go?

for example:

when i run my script it will give me the number of files to be deleted but i can't get a starting count(files and size) or a count (files and size) after i run the delete. I'm wanting this so i can figure out how much space i'm saving by running the clean. Any help would be appreciated.

thanks,



Software/Hardware used:
Python 2.6, PyCharm IDE
ASKED: September 13, 2010  8:26 PM
UPDATED: September 13, 2010  8:27 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following