How can one restore a file that has been deleted but is still open by a process?
The blog post "Restoring files from
/proc" explains how to do this on Linux:
lsof -c name) to find all files currently open for the given process (whose name starts with
name). From the output, you learn the process's
pidand the file descriptor (
fd) of the file you are looking for.
cp /proc/<pid>/fd/<fd>/tmp/restored-file` to make a copy.
The first step works one-to-one on OS X, too. However, step 2 seems more complicated. Is there a similar feature on OS X?
/dev/fd but in my case, it did not contain the PID/FD of my process/file.)