The above information must be entered on the top left side of the first page of your program as comments
Then write a C program that does the following :
1. Using system command , create a new input file ( zp5in-‐1.txt )
2. Append the following to zp5in.txt
Texas State University , Spring 2020 , Unix Programming
3. Close the input file .
4. Display the Current date and time
5. Display Time of last access of the zp5in-‐1.txt
6. Using a system command , display the content of the new created input file.
7. Change the mode of the program such that the user and the group has read / write / execute permission.
8. Use a system command to list file information after changing the file mode.
9. Display System name
10. Display Local host name
11. Display Host name
12. Display The process id
13. Display Parent process id
14. Display The priority level of the process
15. Display The file Name
16. Display The device
17. Display The inode
18. Display The file protection
19. Display Number of hard link
20. Display Owner’s user ID
21. Display Owner’s group ID
22. Display Owner’s effective user ID
23. Display Size of zp5in-‐1.txt file
24. Display Block size for zp5in-‐1.txt file
25. Display Number of blocks allocated to zp5in-‐1.txt file
26. Append The following to zp5in-‐1.txt : Final step.
27. Using a System command , redisplay the content of zp5in-‐1.txt file.
28. Display The time of last access of zp5in-‐1.txt file
29. Rename The file to be zp5in-‐2.txt
30. Using a System command , display The content of the new zp5in-‐2.txt file
31. Display The current date and time
32. Remove zp5in-‐2.txt files from your current Directory.
33. Using system command , display the content of zp5in-‐2.txt file.
Instructions :
1. The programs must be syntactically and logically correct. The program will be tested using Zeus Server at the university using the simple gcc command followed by the filename.c such as gcc ZHW1S89.c
2. Look at the sample run and follow the format.
3. You must upload your solution using TRACS – Make sure you include the above as comments in your program. Everyone must upload an electronic version of the program.
Make sure that you name your homework document as follows :
ZHW5S#.c Where S# is your Serial Number
For example , the file name should look something like : ZHW5S89.c
You must upload your programs no later than the starting of class time on the due date no later than 5:30 pm. No late assignments will be accepted.
• Other ( at least 1.25 point ) if any of the following takes a place :
• Logical Errors.
• Unable to read the source code due to unclear printing
• Incorrect program file name.
• Incorrect input / output file names.
• Not using system commands.
• Incorrect Style such as but not limited to missing program documentations, missing Header comments, missing footer comments, missing or incorrect serial number , incorrect ouput format , not replacing my name with your name … etc.
Sample Run: The Output :
System / File Manipulation Program
1. File is created.
2. Text is appended to the file.
3. File is closed.
4. Current date is :
5. Time of last file access :
6. The content of the file is :
7. File mode is changed 8. File information is :
9. System name :
10. Local host name :
11. Host name :
12. The process id :
13. Parent process id :
14. Priority level of the process : 15. The file Name is 16. The device is :
17. The inode is :
18. The file protection :
19. Number of hard links :
20. Owner’s user ID :
21. Owner’s group ID :
22. Owner’s effective user ID :
23. Size of zp5in-1.txt file :
24. Block size of zp5in-1.txt file :
25. Number of blocks allocated to zp5in-1.txt file :
26. New text is appended zp5in-1.txt file.
27. Redisplaying the content of zp5in-1.txt file.
28. The time of last access of zp5in-1.txt file :
29. Renamed The file to be zp5in-2.txt .
30. The content of the new zp5in-2.txt file :
31. The current date and time :
32. Removed zp5in-2.txt files from current Directory.