Question: Write a program in C which takes in zero or more command-line arguments specify directories. The program is to find the largest file and output

Write a program in C which takes in zero or more command-line arguments specify directories. The program is to find the largest file and output the path of the file in any of those directories.
ftw(), fts(), nftw() and similar functions can not be used.  Write a program in C which takes in zero or more

3. Directory traversal: largest file Write a program in C named "maxfile" which takes zero or more command-line arguments which specify directories. Its output is a single line containing the path name of the largest file in any of those directories. If there are no command-line arguments, it searches the current directory (and below) The path name must be output in terms of the argument to maxfile. For example, if you run "maxfile foo", the output would look more like "foo/bar/bigfile" than like "/u/ajr/foo/bar/bigfile". Just concatenate the additional path name components to whatever string the user specifies You may impose a maximum path length of 1000 chars, but you must not exceed array bounds even if this path length would be exceeded (you can, however, abort with an error message in such cases, rather than having to deal with longer path names) You may not use ftw0. ftsO, nftwO,or similar library functions (the point of this assignment question is to implement the filesystem-tree traversal)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!