Right now I have figured out everything using <sys/stat.h> (except for name i used dirent.h) but I can not figure out how to determine permissions using st_mode (S_IRWXU : read, write, execute/search by owner, S_IRWXG : read, write, execute/search by group, S_IRWXO : read, write, execute/search by others ). If anyone could help that would be amazing!
(80%) Basic find function implementation: The find function should have following format: find <search path> <option> <target> - search path is the path from which the program starts looking for the target. - options is dedicated to type of search on files in the search path. In the following table different options (arguments) with their corresponding comments are shown. - target is the search target. “find” Function Category Sub-Category Option Format Example File Attributes (20%) File Name -name string (char *) myfile File Size -size long int (B) 12323 You do not have to handle wild cards. Ownership (20%) User ID -uid integer 150 Group ID -gid integer 170 Time Attributes (20%) Last Access Time -atime “%T-%D” “11:32:16-01/11/08” Last Modify Time -mtime “%T-%D” “11:32:16-01/11/08” Last Status Change Time -ctime “%T-%D” “11:32:16-01/11/08” File Permissions (20%) Permission Number -perm integer 666 Note that permissions in this project are represented by permission number which contains three octal digits where first digit is dedicated to the file owner, the second one for the group members and the third one is assigned to the other users. Each digit is calculated based on the following table. Octal digit Text equivalent Binary value Meaning 0 --- 000 No access is granted 1 --x 001 Execute access is allowed only 2 -w- 010 Write access is allowed only 3 -wx 011 Write and execute access are allowed 4 r-- 100 Read access is allowed only 5 r-x 101 Read and execute access are allowed 6 rw- 110 Read and write access are allowed 7 rwx 111 Everything is allowed For instance, number 644 represents following permission policy: owner: read and write permissions, group: only read permissions, others: only read permissions.


Sign In
Create Account


Back to top









