Skip to content

[BUG] oiiotool not returning correct error code for wildcard + missing file #4623

@lgritz

Description

@lgritz

Paraphrased from a discussion on the Slack where a user said:

Today I stumbled on an interesting behaviour in oiiotool that shadowed another (internal) bug and got my head scratching for a bit.
Image you’re doing a simple operation, but none of the input files exist. oiiotool will nicely report that as an issue:

$ oiiotool --runstats non-existent.exr non-existent.exr  --over -o test.exr
oiiotool ERROR: read : File does not exist: "non-existent.exr"

$ echo $?
1

However, if you use the frame syntax to refer to non existent frames, it will not flag any issue, and exit with 0:

$ oiiotool --runstats  non-existent.%04d.exr non-existent.exr --over -o test.exr
oiiotool WARNING : oiiotool produced no output. Did you forget -o?

$ echo $?
0

I tested this is with

$ oiiotool --version
2.5.14.0

Not a biggie, but I wonder if the single-file check that happens in the first case could be expanded to work with the supported syntaxes for frames too?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCrash or wrong behavior of an existing feature.mackerel 🎣Medium sized project that somebody should take on to dive deeper into being an OIIO developer.oiiotooloiiotool

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions