Skip to content

Unability to open generalised "file descriptor" files eg: /proc/self/fd/xxx #4092

@etosan

Description

@etosan

Description

Many unices and unix-like OS-es support special directory in /proc (or elsewhere) to open inherited parent's proces file descriptors as files.

This is often used by advanced shell sub process redirection (bash, zsh and other more advanced shells).

Example:

$ nano <(ls) 
# "opens" directory listing as editable buffer (incoming as "descriptor" file from shell, containing actual output of `ls`)

Unfortunately with micro this fails:

: micro <(ls)                 
Error: /proc/self/fd/11 is not a regular file and cannot be opened

Press enter to continue

micro is probably doing regular file check on it's input file argument and raw file descriptor fails this.
This might be some kind of protection.

However this should be at least specialcased for file prefixes like /proc/self/fd/* on linux, to allow for shell sub-process redirection to work.

Environment

  • Version:
  • OS:
  • Terminal:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions