Re: Piping

1999-12-02 Thread shevek
On Wed, 1 Dec 1999, Adriano Camargo Rodrigues da Cunha wrote: If you think that spawning many processes for a pipe is a waste of resources on low-end systems like MSX you should use the temporary file approach, just like MSXDOS and MS-DOS do. Yeah, I could, but it's not the

Re: Piping

1999-12-02 Thread Adriano Camargo Rodrigues da Cunha
Shevek, 7. [wait for all processes to terminate? only last one?] I tested yesterday. Waiting for all the process to terminate doesn't hangs system anymore. :) BUT: by an unknown reason, the flushing of the pipe is not correct yet. The error seems to be in my

Re: Piping

1999-12-02 Thread David Heremans
Adriano Camargo Rodrigues da Cunha wrote: I thought that "broken pipe" was an error code set by kernel when it tries to write to a pipe that has no readers... Interesting... I'll take a look... In the case of a named-pipe (a fifo-special-file-thing) the writer just goes to sleep, and

Re: Piping

1999-12-02 Thread Alex Wulms
] ] That's what I did yesterday. After the forks, I put a ] for (i=0; i2; i++) { ] if ((wait(status)==pid1) close(pipe_fd[0]); ] else close(pipe_fd[1]); ] } ] After the two forks, the shell should close both ends of the pipe, before going into the

Re: Piping

1999-12-01 Thread Adriano Camargo Rodrigues da Cunha
Hi, again, people. Unix uses the fork()/exec() approach. This was an important explanation, Alex. Thank you. If you think that spawning many processes for a pipe is a waste of resources on low-end systems like MSX you should use the temporary file approach, just like

Piping

1999-11-25 Thread Adriano Camargo Rodrigues da Cunha
Hi, Does anyone knows how a pipe between processes is implemented by UNIX shells? I think that lauching all processes at the same time and piping one to another is an extreme waste of resources. And I know that MS-DOS and MSXDOS2 have pipes and they are monotask OSs

RE: Piping

1999-11-25 Thread Boon, Eric
[Howto] cat fudeba.txt | head 20 | tail 10 | less I know for sure (i.e. 95% ;-)) that Messy DOS uses temporary files in this case... (so actaully does something like: cat fudeba.txt tmp001 head -20 tmp001 tmp002; del tmp001 tail -10 tmp002 tmp003; del tmp002 less

RE: Piping

1999-11-25 Thread shevek
On Thu, 25 Nov 1999, Boon, Eric wrote: [Howto] cat fudeba.txt | head 20 | tail 10 | less I know for sure (i.e. 95% ;-)) that Messy DOS uses temporary files in this case... (so actaully does something like: cat fudeba.txt tmp001 head -20 tmp001 tmp002; del tmp001

RE: Piping

1999-11-25 Thread Frits Hilderink
] [mailto:[EMAIL PROTECTED]]On Behalf Of Adriano Camargo Rodrigues da Cunha Sent: Thursday, November 25, 1999 3:01 PM To: MSX International Mailing List Subject: Piping Hi, Does anyone knows how a pipe between processes is implemented by UNIX shells? I think

Re: Piping

1999-11-25 Thread Alex Wulms
] cat fudeba.txt | head 20 | tail 10 | less ] ] What is the (best) approach? I think that making 4 fork()/exec() ] is an extreme waste of system resources. And I don't know how making the Unix uses the fork()/exec() approach. You can see it if you do the following in one terminal: cat |