Hello, I have a C programming problem I need to do for a class. Unfortunately this class is not a programming class and we are left to learn the basics a C programming on our own. The only programming experience I have is one semester of Java, which doesn't seem to be helping me much for this class. I would appreciate any help even if it is a link to a site that may provide helpful information. The assignment deals with system calls in linux using C programming. I am not even sure how to start this so any information will be a help. Here is the question:
In this assignment, you are going to write a C program, say bush.c.Your program (bush.c) should behave as follows:
• At startup, your program should create the backup directory backup under the user’s home directory if it does not already exist. It should then display the prompt “bush: ” (without the quotes) on the screen and wait for user input (command).
• If the user enters exit, your program should exit.
• If the user enters an empty line, bush.c should simply display the prompt again (on a new line) and wait for user input.
• If the user enters one of the file backup commands (bu, rs, dbu), bush.c should do the specified operation by calling the appropriate functions described below, and then should display the prompt “bush: ” (again, without the quotes) on a new line and wait for user input.
• If the user enters any other command line, bush.c should execute the command within a new process by calling the cmd function described below. After the command has been executed, bush.c should display its prompt on a new line and wait for user input.
Organize your program using the following functions (you will have to implement these functions using the Linux file system calls as much as necessary). Note that the file name, file, is a full path name and each of the following messages should be printed after the string file is replaced with the actual full path name.
void bu (char *file)
If the file to be backed up, file, does not exist, print a message like
The file to be backed up, file, does not exist.
and display the prompt for next command. Otherwise, if there is a file named file within the backup directory, print a message like
The backup already contains a file named file.
and display the prompt for next command. Otherwise, copy the file to be backedup, file, into the backup directory, backup (under the appropriate subdirectory).
void rs (char *file)
If the file to be restored, file, does not exist in the backup directory, print a message like
The backup does not contain the file, file, to be restored.
and display the prompt for next command. Otherwise, copy the backup file into its proper location (even if it already exists).
void dbu (char *file)
If the backup file to be deleted, file, does not exist within the backup directory, print a message like
The backup does not contain the file, file, to be deleted.
and wait for the next command. Otherwise, delete the specified file from the backup directory using the unlink systemcall.
void cmd (char *cmdln)
Create a new process and execute the command in cmdln within this process.
void init
Initialize the backup by creating the backup directory (backup) under the user’s home directory, if it does not already exist.
Write your main program appropriately using the above functions.