[zfec] #14: [patch] Make streaming from stdin / to stdout work.

Eric Pollmann eric at pollmann.net
Mon Mar 2 19:21:15 UTC 2015


Thanks for the improvement! I just simplified the patches to
use args.inputfile == '-' which implements exactly what the documentation
says.  For what it's worth, args.inputfile.fileno() ==
 sys.stdin.fileno() works great too (though with
http://man7.org/linux/man-pages/man2/dup.2.html I don't know if equality of
FD # is guaranteed either), and all three implementations tested fine for a
file named '<stdin>'.



On Sun, Mar 1, 2015 at 11:30 AM, zfec <trac at tahoe-lafs.org> wrote:

> #14: [patch] Make streaming from stdin / to stdout work.
> ------------------------------+---------------------------
>      Reporter:  ericpollmann  |      Owner:  zooko
>          Type:  defect        |     Status:  new
>      Priority:  major         |  Milestone:
>     Component:  component1    |    Version:
>    Resolution:                |   Keywords:  review-needed
> Launchpad Bug:                |
> ------------------------------+---------------------------
>
> Comment (by davidsarah):
>
>  I reviewed [attachment:zfec-1.4.24-streaming-new.patch] (without testing
>  it) and it looks good, including the tests.
>
>  Review question:
>  * Is `sys.stdin.name` documented to be `"<stdin>"`, or is that a CPython
>  standard library implementation detail? Perhaps use
>  `args.inputfile.fileno() == 0` (or `args.inputfile.fileno() ==
>  sys.stdin.fileno()` which should be equivalent)?
>
> --
> Ticket URL: <https://tahoe-lafs.org/trac/zfec/ticket/14#comment:5>
> zfec <https://tahoe-lafs.org/trac/zfec>
> efficient erasure-coding library
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tahoe-lafs.org/pipermail/tahoe-dev/attachments/20150302/a373847a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zfec-1.4.22-streaming.patch
Type: application/octet-stream
Size: 7858 bytes
Desc: not available
URL: <http://tahoe-lafs.org/pipermail/tahoe-dev/attachments/20150302/a373847a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zfec-1.4.24-streaming.patch
Type: application/octet-stream
Size: 7859 bytes
Desc: not available
URL: <http://tahoe-lafs.org/pipermail/tahoe-dev/attachments/20150302/a373847a/attachment-0001.obj>


More information about the tahoe-dev mailing list