There is a function called
. It is used to get information about a file. With your table partner, write a program that uses stat to display the following information about a file:
- file size
- mode (permissions)
- time of last access (displayed in the following format:
Fri Oct 28 09:03:01 2016
Added 10/31. In the same file:
- Modify the size so it is printed out in human readable form (that is using B, KB, MB, GB).
- Attempt to print out the permissions in ls -l form, ignoring the early bits that include the file type information (the permissions section of the mode is stored in the last 9 bits of the data type).
Github clone url: