next up previous index
Next: Using PFTP on AVIDD Up: Moving Data Between HPSS Previous: Program mkrandfile

Exercises

1
Function sscanf returns  the number of input items assigned. These may be fewer than what the code provides for, or even zero. Use the return value of function sscanf to capture a possible input error in the 'l' case of the getopt while loop and exit the program, raising an error flag, if such has been detected.
2
Implement a command line option that lets the user change the value of ARRAY_LENGTH.
Hint 1
ARRAY_LENGTH must be replaced with a variable.
Hint 2
Because ARRAY_LENGTH is now a variable, junk can no longer be a statically sized array. Instead you will have to allocate  it dynamically with, e.g., malloc.
Hint 3
You must check if malloc has been successful, before you can do anything else.
3
The listings in the previous section present RCS identification strings bordered by percent signs. They should actually be bordered by dollar signs, but this results in unfortunate interference with the RCS system used to maintain this document. Read man 7 co on  the AVIDD cluster to learn about RCS keywords. Add option -v that prints the version of the program (its revision number) as generated automatically by RCS.
4
Amend the manual page to reflect the enhancements made to the program.
5
Use the new program to check if GPFS I/O depends  on the size of the junk array. Is there an optimum value?


next up previous index
Next: Using PFTP on AVIDD Up: Moving Data Between HPSS Previous: Program mkrandfile
Zdzislaw Meglicki
2004-04-29