This page contains some materials presented by Serguei on Friday labs for the COMP229/4 course, 2002.
Please report any typos, bugs, corrections, and suggestions to mokhov@cs.concordia.ca.
$ setenv LD_LIBRARY_PATH your_so_lib_dir
cmdwnd.c, updated) is a first proposed example for the A4 on how to run a
program in a new window and quit at user's request. The example
illustrates the cal command hardcoded in, but you
should allow any command in your assignment solution (which is not hard to do at all :)). Please also review the
fork() and exec() notes below (Process System Calls) and man xterm.
For the convenience I also provided a Makefile. To run it to see how it works: (a) download all
the files, (b) compile (type in make), and (c) run: ./cmdwnd
cmdwnd program spawns and execs an xterm window with the -e option
asking to run cmdwnd again with a desired command. The second incarnation of cmdwnd just
forks a copy of itself and execs the desired command. Than the what was an xterm before
waits for the command to be completed and prints the prompt as per assignment requirements.
cmdwnd-m.c. Methodology:
instead of runing ourselves twice with different options, we ask the shell (tcsh in our
case) to do it for us in the spawned xterm. A bit not conformant with assignment requirements,
but much simpler to understand and to use, thus, maybe recommended over the former.
#include lines add this:
... #include "sysutil229.h" ...
$ gcc -g ifv.c sysutil229.c -o ifv
$ gcc -g shlnno.c sysutil229.c -o shlnno$ ./shlnno shlnno.c
system(): clr.cfork() example: fork_pid.cfork(): fork_child.cexec() example: exec_pid.cfork() and exec() combined: fork_exec.cEvery user on the system is allotted some disk space for their files. Since there are many students out there, quotas aren't so high and people often tend to leave unneeded files, which count against their disk quota. Once you have exceeded your allotted storage, you won't be able to save anything until you free up some space.
In general, typical files students are working with, are not of such a great size; however, there are some system files, sometimes quite large, which you might not be aware of, but they still count against your quota. A typical so troublesome example is the Netscape browser, which leaves after itself a lot of cached pages if not configured properly. After moderate browsing you can easily have your quota used up.
Hints on how to solve the problem. Type the quota
command to actually see the quotas for your account. If they exceed
allotted space, delete unneeded files and the .netscape directory. In most
cases this is more than enough. The .netscape directory is in your home and marked
as system, and thus, by a simple ls not shown. Use ls -a or better yet
ls -al. Type \rm -r ~/.netscape to remove it. Another torublemaker could be
a core dump from a crashed program, which takes up sometimes quite a lot of space. Most of
the time you don't need it, so there's no need to keep it too. Check your quota again, and if it's not enough, see what else you can remove. The du -h
command will show you disk usage for all the directories starting from your current, and pay special
attention to those that take a lot of space as first candidates to removal.
References:
man quota
man du
man ls
man rm
Maintained by Serguei A. Mokhov, mokhov@cs.concordia.ca