Skip to content

xv ignores input files specified via bash process substitution #36

@ahmogit

Description

@ahmogit

Since ancient times (at least since 3.10 with Jumbo Patches) xv has ignored input files that are specified via bash process substitution, e.g.

$ xv <(cat somefile.jpg)

which should, ideally, behave as equivalent to

$ xv somefile.jpg

Looking at the xv.c argv handling, it appears that the /dev/fd/NN fifo symlink (which bash creates as the target filename when the process substitution is performed) is ignored simply because parseCmdLine() does a stat(2) on /dev/fd/NN and checks against filetype ISREG, which (as expected) fails for the /dev/fd/NN symlink-to-fifo. So the /dev/fd/NN filename never gets placed into namelist[], hence is completely ignored.

I attempted a quick workaround of simply changing the filetype test to accept either ISREG or ISFIFO. This does get past the initial argv processing, i.e. /dev/fd/NN gets deposited into namelist[], but alas that led to other problems further down the road when the /dev/fd/NN fifo is opened for imagetype assessment, and wasn't able to quickly come up with a simple approach to address that properly.

It may in turn out to be tricky to accomodate the /dev/fd/NN symlink-to-fifo without major surgery, but figured might as well ask. It would make a nice convenience enhancement to handle process substitution transparently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions