Question: I'm coding for the UNIX environment using the C++ language. So I'm supposed pipe one function with another function that displays a line that contains

I'm coding for the UNIX environment using the C++ language.

So I'm supposed pipe one function with another function that displays a line that contains a certain string. (filecount function and filedisplay function)

The first function with a given argument that contains a directory, it recursively finds all files and directories and returns how many files and directories are in the given directory.

So if I type in filecount /usr/ | filedisplay -d it should display only how many directories there are.

And if i type in filecount /usr/ | filedisplay -f it should display only how many files there are.

So far I'm finished with filecount but I don't know how to write filedisplay.

If I run only the file count it displays both the information about # of directories and files in two lines.

Could you help me with this problem may be using regex?

fileDisplay is another cpp file that will be used for Pipe

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!