Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Submit ONE BIG CODE using onlinegdb.com What to do ? Write a C program myfind whose behavior resembles that of the system command f ind.

Submit ONE BIG CODE using onlinegdb.com
What to do?
Write a C program myfind whose behavior resembles that of the system command f ind.
myfind accepts the following parameters:
$ myfind filename startpath
where
filename is a substring that is matched against each filename in each directory that my f ind
inspects. If a file name matches f ilename or if the substring filename occurs within a file
name, the name of that file is printed.
startpath is an optional parameter that specifies the directory where myfind must start the
search. If this parameter is not specified, my f ind starts in the current directory.
For each file whose name is a match, myfind must print its name and its mode.
For each directory in which myfind finds a match, it must print that directory's full path.
Test myfind using various directories on your computer attempting to match full and partial file names.
Sample files and directories are available in the class github repository. Below is a typical output produced
by myfind
Note: you are not allowed to use ftw() or any similar library function.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions