Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You program must accept the following parameters (if present): -O: specifies the age of the oldest files (modification timestamp) to be listed from the target
You program must accept the following parameters (if present): -O: specifies the age of the oldest files (modification timestamp) to be listed from the target directory. The -o argument will be followed by an integer (as a separate parameter to make things easier if you wish). This integer will represent the minimum number of days old the files can be in order for them to be included in your listing. As an example "-o 3" passed as arguments would mean: list all files that have been modified more than 3 days ago (from the current system time). -y: specifies the age of the newest files (modification timestamp) to be listed from the target directory. The -y argument will be followed by an integer (as a separate parameter to make things easier if you wish). This integer will represent the maximum number of days old the files need to be in order for them to show up in your listing. You can think of the -y to represent YOUNGER THAN. As an example "-y 7" passed as arguments should represent list all files whose modification timestamp is less than 7 days older than the current system time. -1 (lower case L): This specifies a minimum file size for the files to be listed. In essence, list ass files that are LARGER than the value given. -s: List all files which are smaller than the value given. So this is the maximum size a file can be to show up in the listing. You should use the time() functions to find the current epoch time. You can then add/subtract the appropriate number of second (ignoring leap years) to get a valid timestamp to compare to the stat() values. You program must accept the following parameters (if present): -O: specifies the age of the oldest files (modification timestamp) to be listed from the target directory. The -o argument will be followed by an integer (as a separate parameter to make things easier if you wish). This integer will represent the minimum number of days old the files can be in order for them to be included in your listing. As an example "-o 3" passed as arguments would mean: list all files that have been modified more than 3 days ago (from the current system time). -y: specifies the age of the newest files (modification timestamp) to be listed from the target directory. The -y argument will be followed by an integer (as a separate parameter to make things easier if you wish). This integer will represent the maximum number of days old the files need to be in order for them to show up in your listing. You can think of the -y to represent YOUNGER THAN. As an example "-y 7" passed as arguments should represent list all files whose modification timestamp is less than 7 days older than the current system time. -1 (lower case L): This specifies a minimum file size for the files to be listed. In essence, list ass files that are LARGER than the value given. -s: List all files which are smaller than the value given. So this is the maximum size a file can be to show up in the listing. You should use the time() functions to find the current epoch time. You can then add/subtract the appropriate number of second (ignoring leap years) to get a valid timestamp to compare to the stat() values
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started