 | | dup returns a new file descriptor that references the same file as fd. The new descriptor has the same access mode (read, write, or read/write) and the same read/write offset as the original. The file descriptor returned is the lowest numbered one available. dup2 causes the file descriptor fd2 to refer to the same file as fd. If fd2 refers to an already-open file, that file is closed first. | |
|