Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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