Creates a new file referring to the same file description.
impl File {
fn duplicate(&self) -> Result<File, Errno>
}Returns the new file.
The close on exec flag will be set on the new file.
The new file has its own file descriptor which refers to the same file description. This means that changing the close on exec flag on this file will not affect the other file and neither does closing this file. But writing, reading, seeking, etc. will affect the other file.