/Systems_Programming

Systems programming case study.

Primary LanguageHTML

Systems Programming - getdiskusage - case study

Script utility that allows developers to debug disk space for a directory.

Description

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.

Getting Started

Dependencies

  • 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
Optional

Installing

Executing program

  • 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

Help

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

  • 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.

Test proof

Author

Jacob Zukauska