I gang

C program, simulate pipes | and count bytes of command in a file

./tally cat [login to view URL] : grep left : grep ha ....... tally executes a sequence of commands in parallel. The commands are separated by a colon: which acts as a redirect. The redirects made by: are implemented by UNIX sockets with local communication. So, just like | in a shell pipeline, tally with: connect the commands to each other. The standard output of one command is therefore redirected to the standard input of the next command. The standard input of the first command corresponds to the standard input of tally, and the standard output of the last command corresponds to the standard output of tally (usually the terminal in both cases). The standard output for error messages is not changed. The number of bytes that go through each redirect: is counted and written to a count file that will be in the directory where tally will run. For each redirection: the count file will contain a line with the following information, - the order of the redirection in the pipe (the account starts at 1), - followed by the characters: (a space,: and a space), - then the number of bytes that have passed through the redirection, - a line break \ n to end the line.

70% of the work is done (pipes, forks, execs) I just need to know how to count the bytes of each command and write in a file.

Example

./tally cat [login to view URL] : grep left

will output the result in the terminal as if it is cat [login to view URL] | grep left and create a file with bytes of each command (cat [login to view URL]) and (grep left of cat [login to view URL])

Output file example:

1 : 122

2 : 4

compile with make and run tests with make check

Evner: C programmering, C++ Programmering, Linux, Software Arkitektur, Montage

Se mere: program will count line external file, program will count lines external file, count characters text file command line, asm program count number words file, assembly language program count letters text file sort frequency , solution write test mips assembly language program count letters text file, count words text file program, convert open source command-line c++ program to pure java, c program example for reading csv text file, c program to open a file using command line arguments, c program to write data into a file, c program for encryption and decryption of file, c program to count the number of occurrences of a character in a file, c program to count the frequency of words in a text file., c program to create a file using command line arguments, c program to count number of lines in a file, c program to sort records in a file, c program to read data from xml file, c program simulate virtual memory

Om arbejdsgiveren:
( 0 bedømmelser ) Montreal, Canada

Projekt ID: #32313009

Tildelt til:

coder10213

Dear sir I have a lot of experiences in c/c++, java, python algorithm and data structure. I'm sure i can make a good result for you in a short time. Thanks sir Waiting for you reply.

$20 CAD på 1 dag
(0 bedømmelser)
0.0