Skip to content

install with piped input fails if target file exists #12407

Closed

Description

Reproduction steps

$ echo foo | install /dev/stdin bar
$ echo foo | install /dev/stdin bar
install: No such file or directory

Expected behaviour

Piped content is written to target file as per coreutils behaviour, regardless of whether target file exists.

Actual behaviour

Error message printed about missing file only if target file already exists.

From an strace it looks like it trips up chasing symlinks for the stdin pipe:

readlink("/proc", 0x7ffe5f48f540, 1023) = -1 EINVAL (Invalid argument)
readlink("/proc/self", "328710", 1023)  = 6
readlink("/proc/328710", 0x7ffe5f48f540, 1023) = -1 EINVAL (Invalid argument)
readlink("/proc/328710/fd", 0x7ffe5f48f540, 1023) = -1 EINVAL (Invalid argument)
readlink("/proc/328710/fd/0", "pipe:[2063159]", 1023) = 14
readlink("/proc/328710/fd/pipe:[2063159]", 0x7ffe5f48f540, 1023) = -1 ENOENT (No such file or directory)

Activity

  1. changed the title [-]`echo foo | install /dev/stdin bar` fails if `bar` exists[/-] [+]install with piped input fails if target file exists[/+] on May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions