This command combines ln and mv into one command. It allows the user to link/unlink files, move files, and rename files.
sa [d|l|m|r|u] ARG1 [ARG2]
d - (rm) deletes a file named ARG
l - (ln) creates a link named ARG1 to file ARG2.
m - (mv) moves a file named ARG1 to ARG2. If ARG2 is a directory, the file is moved into the directory. If ARG2 is a file, it's overwritten.
r - renames a file or directory named ARG1 to ARG2.
u - deletes a link named ARG1
sa d sleep deletes file s;eep, if it exists
sa l sleep eage creates a link named sleep to a file named eage
sa m file /tmp moves file to /tmp
sa r foo bar renames foo to bar
sa u spam deletes link named spam
sa displays snopsis
An appropriate error message should be displayed as needed. For example, if the user specifies in invalid directory with the c option or an invalid filename for the l option.
#define OPTION_LENGTH 1
#define SAMPLE_OPTION_LENGTH 5
#define COMMAND_LENGTH 200
#define ERROR_MESSAGE_LENGTH 1000
EMPTY_OPTION = 1,
DELETE_FILE = 100,
* test input arguments
* @param argc
* @param argv
* @return next state of the program
int preTesting(int argc, char** argv);...
By purchasing this solution you'll be able to access the following files: