Find Jobs
Hire Freelancers

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

$10-30 CAD

Në vazhdim
Postuar over 2 years ago

$10-30 CAD

Paguhet në dorëzim
./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
ID e Projektit: 32313009

Rreth projektit

Projekt në distancë
Aktive 2 yrs ago

Po kërkoni të fitoni para?

Përfitimet e ofertës për Freelancer

Vendosni buxhetin dhe afatin tuaj
Paguhuni për punën tuaj
Përshkruani propozimin tuaj
Është falas të regjistrohesh dhe të bësh oferta për punë

Rreth klientit

Flamuri i CANADA
Montreal, Canada
0,0
0
Mënyra e pagesës u verifikua
Anëtar që nga sht 22, 2014

Verifikimi i klientit

Faleminderit! Ne ju kemi dërguar me email një lidhje për të kërkuar kredinë tuaj falas.
Ndodhi një gabim gjatë dërgimit të email-it tuaj. Ju lutemi provoni përsëri.
Përdorues të regjistruar Punë të postuara
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Po ngarkohet shikimi paraprak
Leja u dha për Geolocation.
Seanca e hyrjes ka skaduar dhe ke dalë. Hyr sërish.