Retrieve filename from file descriptor in C

前端 未结 7 1603
野性不改
野性不改 2020-11-22 12:48

Is it possible to get the filename of a file descriptor (Linux) in C?

7条回答
  •  温柔的废话
    2020-11-22 13:41

    Impossible. A file descriptor may have multiple names in the filesystem, or it may have no name at all.

    Edit: Assuming you are talking about a plain old POSIX system, without any OS-specific APIs, since you didn't specify an OS.

提交回复
热议问题