title: Reopen a file descriptor with another access?
body: <p>Assume the OS is linux.  Suppose I opened a file for write and get a file descriptor <code>fdw</code>.  Is it possible to get another file descriptor <code>fdr</code>, with read-only access to the file without calling <code>open</code> again?  The reason I don't want to call <code>open</code> is the underlying file may have been moved or even unlinked in the file system by other processes, so re-use the same file name is not reliable against such actions.  So my question is: is there anyway to open a file descriptor with different access right if given only a file descriptor?  <code>dup</code> or <code>dup2</code> doesn't change the access right, I think.</p>