CT320: Network and System Administration

Fall 2019

HW 7

CT320 HW7: Size matters

Description

For this assignment, you will write a program called bigness that enforces limits on disk space. OK, it doesn’t enforce them—it just complains when the limits are violated.                 

Limit Files

bigness takes, as arguments, at least one limit file, as described below.                 

FormMultiplierExplanation
integer1just the number
integerDZ12dozen
integerTH103thousand
integerMY104myriad
integerMI106million
integerBI109billion

Action

bigness will check to see if any of the requirements are violated. Each requirement that is violated must produce a message to {{abbr|stdout|standard output, where the normal output goes}} that is exactly of one of these forms:                 

I’m serious about “exactly”. Change the italic words, but nothing else. Spelling counts. Upper-/lower-case counts. Spaces count. Punctuation counts.                 

Sample Run

Here is a sample run, where “%” is my shell prompt:

% cat constraints
# We’re interested in the home directory of this user:
games

# On our systems, the home directory of user “games” is /usr/games,
# which is empty.

# I expect this to pass:
t<10MI
# I expect both of these to fail:
n>4
n>100bi
% ./bigness constraints
/usr/games: too few files, should be more than 4
/usr/games: too few files, should be more than 100bi
% ./bigness bogusfile
./bigness: no such file “bogusfile”

Debugging

If you encounter “STACK FRAME LINK OVERFLOW”, then try this:

    export STACK_FRAME_LINK_OVERRIDE=ffff-ad921d60486366258809553a3db49a4a

Requirements

Implementation & Testing

You may write your program in any language that we have on the CS Dept. computers in CSB 120. For example, awk, bash, c, c++, csh, fortran, go, julia, lisp, lua, perl, php, python2, python3, and ruby are all permitted.                 

We will test your program like this:

  1. If a Makefile was turned in: make bigness
  2. chmod u+x bigness
  3. ./bigness quotafile1 quotafile2

Submission

Use web checkin, or:

    ~ct320/bin/checkin HW7 bigness

or:

    ~ct320/bin/checkin HW7 Makefile bigness.c

or whatever other files your solution uses.                 

Turn in your script or source code, not the output of a compiler.                 

How to receive negative points:

Turn in someone else’s work.