Script utility that allows developers to debug disk space for a directory.
Write a program in a language of your choice which will take a mount point as an argument and return a list of all the files on the mountpoint and their disk usage in bytes in json format.
- Python
- Operating system that allows python to be installed and executed
- Python command reachable from terminal / command line
- Python minimum versions 2.7 or 3.2 compatible
- See https://www.python.org/downloads/ for install instructions
- Git command line
-
Download Zip Method
- Download https://github.com/jzukauska/Systems_Programming/archive/master.zip
- Extract to your preferred folder
- Navigate to that folder
-
Git Method
- open terminal or command line
-
git clone https://github.com/jzukauska/Systems_Programming.git
-
cd Systems_Programming
- Ensure command line or terminal is open in directory that getdiskusage.py is available
python getdiskusage.py /insert/directory/here
- Other options include
python getdiskusage.py ./currentWorkingDirectory
python getdiskusage.py ../relativeParentDirectory
You can run python getdiskusage.py -h
for a reminder
python getdiskusage.py -h:
usage: getdiskusage.py [-h] path
Find file sizes and output json from path
positional arguments:
path Path of directory to get files
optional arguments:
-h, --help show this help message and exit
- Test can be run with
python test_getdiskusage.py
- It requires that the test directory shipped with this repository be in the same directory you extracted getdiskusage.py to in order to test known relative directory schemas.
Jacob Zukauska