A Python script that recursively scans a directory and outputs a detailed listing of all files and subdirectories, including sizes, modification dates, and depth.
- Recursively traverses any folder tree
- Displays file sizes in human-readable format
- Shows last-modified timestamps
- Indented output that reflects folder depth
- Useful as a quick audit tool or learning exercise for
os.walk()
| Category | Technology |
|---|---|
| Language | Python 3 |
| File System | os, pathlib (built-in) |
| Formatting | datetime, math (built-in) |
python DirectoryScanner.pyYou will be prompted to enter the path to scan.
- Recursive directory traversal with
os.walk() - Formatting file sizes (bytes → KB → MB)
- Using
os.path.getmtime()for file timestamps - Building structured text output with indentation
Made with ❤️ as part of a learning journey