Re: Creating Compressed Loop FS from stdin

From: ari edelkind (edelkind-freebsd-hackers_at_episec.com)
Date: 12/30/04

  • Next message: Peter Pentchev: "Re: Creating Compressed Loop FS from stdin"
    Date: Thu, 30 Dec 2004 09:23:56 -0500
    To: freebsd-hackers@FreeBSD.ORG
    
    

    roam@ringlet.net wrote:

    > > It will not help, since AFAIK you can't seek stdin anyway, or even if I
    > > am wrong and you can seek it to the end you will be unable to seek it
    > > backward.
    >
    > I tested the patch before posting it, fully expecting to find that stdin
    > really cannot be seeked (sought? :), and surprisingly it worked, at least
    > on RELENG_5 as of today!

    You can always seek stdin, if stdin happens to be associated with a
    seekable descriptor. It isn't given any special treatment simply
    because it has a vector of 0. That is, if you use something along the
    lines of:

        % ./seekme </etc/services

    then /etc/services is associated with descriptor 0, and you can seek all
    you like. If you use

        % cat /etc/services |./seekme

    ... then the descriptor isn't associated with a file, and you'll run
    into problems.

    ari

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Peter Pentchev: "Re: Creating Compressed Loop FS from stdin"

    Relevant Pages

    • Re: [PATCH] open: introduce O_NOSTD
      ... from stdin, and the fact that stdin was closed must not interfere with ... On the other hand, if b exists, coreutils' cp ... cp: error closing file: Bad file descriptor ... a standard descriptor but only on the execution paths that actually used ...
      (Linux-Kernel)
    • Re: Simulate qui thread in console app and recieve signals
      ... like also it to be able to break stdin reading loop, ... descriptor and the main ... The main thread can wait for events on several file descriptors using ... The other thread can use that datagram socket to ...
      (comp.unix.programmer)