device or pipe - Linux

This is a discussion on device or pipe - Linux ; I would like to experiment with pipes or device modules which ever is best. I want one pipe (for example) to read a string from another and write the string. Kinda not good for anything but it's a learning experience. ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: device or pipe

  1. device or pipe

    I would like to experiment with pipes or device modules which ever is
    best. I want one pipe (for example) to read a string from another and write
    the string. Kinda not good for anything but it's a learning experience. One
    pipe would have to write and another read. Or would this be done better with
    device modules? I what to use the system calls not the kernel its self.

    Bill



  2. Re: device or pipe

    On Wed, 30 Apr 2008 18:47:17 GMT Bill Cunningham wrote:

    | I would like to experiment with pipes or device modules which ever is
    | best. I want one pipe (for example) to read a string from another and write
    | the string. Kinda not good for anything but it's a learning experience. One
    | pipe would have to write and another read. Or would this be done better with
    | device modules? I what to use the system calls not the kernel its self.

    Pipes themselves do not do the reading or writing. A process with an open
    file descriptor associated with an end of a pipe can read from or write to
    the pipe. The general purpose is for one process to be able to write data
    that another process then reads. But a process could have both ends of the
    same pipe and write one end and read the other (but be careful as the write
    can block when the pipe is full, preventing that process from reading the
    other end of the pipe to empty it enough for the write to finish).

    --
    |WARNING: Due to extreme spam, I no longer see any articles originating from |
    | Google Groups. If you want your postings to be seen by more readers |
    | you will need to find a different place to post on Usenet. |
    | Phil Howard KA9WGN (email for humans: first name in lower case at ipal.net) |

  3. Re: device or pipe


    wrote in message
    news:fvbf3c31atn@news1.newsguy.com...

    > Pipes themselves do not do the reading or writing. A process with an open
    > file descriptor associated with an end of a pipe can read from or write to
    > the pipe. The general purpose is for one process to be able to write data
    > that another process then reads. But a process could have both ends of
    > the
    > same pipe and write one end and read the other (but be careful as the
    > write
    > can block when the pipe is full, preventing that process from reading the
    > other end of the pipe to empty it enough for the write to finish).
    >

    So the steps I probably need is to fork a process to read from one pipe
    then a new process to write to another pipe. Hum. Then would I need a
    process to cause the pipe that has been written to to print its data ? Am I
    understanding correctly?

    Bill



  4. Re: device or pipe

    On May 1, 1:17 pm, "Bill Cunningham" wrote:

    > So the steps I probably need is to fork a process to read from one pipe
    > then a new process to write to another pipe. Hum. Then would I need a
    > process to cause the pipe that has been written to to print its data ? Am I
    > understanding correctly?


    I don't think so, since "cause the pipe that has been written to to
    print its data" is incoherent. Since a process is reading the data
    from the pipe, the data won't be in the pipe except before it gets a
    chance to read it.

    DS


  5. Re: device or pipe

    man pipe(2).

+ Reply to Thread