To know about anything related to files (channels are also files of some type) under Unix: the file name is used only when opening a file. Later, until the file is opened, it will be available forever before closing, and the name will never be used again. When someone deletes a file in another window while it is open, the name just leaves, not the file. It means:
- The file is still on disk.
- He has no name
- He is still open
- When it is closed, the core removes it forever
Knowing this, perhaps, helps to understand why it would be almost impossible to “reopen” a file, pipe, or something like that again. The file name and descriptor have different lifetimes.
The only exceptions are stdout and stderr, whose handle is always known as 1 and 2.
source share