Write a program called mysync to synchronize two files


Programming: mysync
Write a program called mysync.c to synchronize two files or directories.
â Will be executed as ./mysync SOURCE DESTINTION
â You CANNOT use any shell commands in your program.
â We try to synchronize DESTINTION with SOURCE. This means DESTINTION will be an accurate copy of SOURCE. 
o Both SOURCE and DESTINTION should be files or directories. If one is a file and another is a directory, delete DESTINTION and copy SOURCE over (use your mycp function).
o If DESTINTION doesn't exist, copy SOURCE over (use your mycp function).
o If both are files, check modification timestamps. If SOURCE is newer, copy it into DESTINTION (use your mycp function).
o If both are directories, read out the names of containing files/subdirectories (similar to myll function) and save them into two lists.
ï If any list member is in SOURCE, but not in DESTINTION, copy it into DESTINTION.
ï§ If any list member exists in both lists, check their time stamps.
⢠Be careful: for subdirectories, you need to step into them with recursive function call (implement this as a function so that you can call it recursively. 
o For recursive calls, two new lists will be generated. Do NOT mess them up with the ones for their parent/grandparent directories. 
⢠Otherwise, do something depending on their timestamps.
ï§ If any list member is not in SOURCE, but in DESTINTION, delete it from DESTINTION.
⢠In the beginning of your program, write comments to answer the following questions:
o Have you implemented the synchronization functionality or just copy functionality? Or can you compare timestamps?
o Do you have directory deletion functionality?
o Can you compare two lists for extra or missing files/directories?
o Can you handle subdirectories (recursive execution)?
⢠Test your program and show the results in the script (do NOT use vi in the script) 

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a program called mysync to synchronize two files
Reference No:- TGS0131023

Expected delivery within 24 Hours