Find Jobs
Hire Freelancers

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

$10-30 CAD

Em Andamento
Publicado há mais de 2 anos

$10-30 CAD

Pago na entrega
./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 do Projeto: 32313009

Sobre o projeto

Projeto remoto
Ativo há 2 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos

Sobre o cliente

Bandeira do(a) CANADA
Montreal, Canada
0,0
0
Método de pagamento verificado
Membro desde set. 22, 2014

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.