Knowledgebase

Automating File and Folder Tasks Print

  • python, permissions, guide, howto, solution, zillionkinghost, hosting, support
  • 0

Working with the filesystem in volume.

WHAT PYTHON DOES WELL

Renaming in bulk Sorting files into folders Finding files by pattern Cleaning up by age Checking for duplicates

WHAT TO DO BEFORE ANY BULK OPERATION

Run it in a mode that reports without acting.

Verify the list is what you expect.

WHY

A bulk operation on the wrong pattern is destructive and immediate.

WHAT TO BE CAREFUL WITH

Deleting Overwriting Moving files out of their location Recursing further than intended

WHAT TO CHECK

That the path is what you think That you are not following links out of the intended tree

WHAT TO PREFER

Moving to a holding folder over deleting.

WHAT TO LOG

Every file affected.

WHY

So an unintended operation can be reversed.

WHAT TO BACK UP FIRST

Anything irreplaceable.

WHAT TO TEST ON

A copy, with representative examples including awkward filenames.

WHAT TO HANDLE

Permission errors, missing files, and names with unusual characters.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot