4 ms·
How the Windows Subsystem for Linux bridges file systems
- _nalply 10y agoWhen I worked with Cygwin I discovered that Windows still locks files such that they can't be deleted. An example: I write a paper with LaTeX. When Adobe Reader has the PDF open, pdflatex fails. It's annoying because it's interrupting the workflow. On Linux however, the file can be deleted. Processes which still have the inode can continue to use the file. This is used by log-rotate: rename the log file, and the server process continues to write to the renamed log file. Then restart the server process and a new log file is created. This discrepance which Cygwin can't overcome led me to give up on Windows with Cygwin completely. And now: Does the Windows Subsystem for Linux allow deleting locked files such that software like Adobe Reader believe they still hold on the file?
- _nalply 10y agoIt seems so: «Linux has some different semantics surrounding unlinking and renaming. Specifically, a file can be unlinked even if there are open file descriptors to the file. Similarly, a file can be overwritten as the target of a rename operation even if it’s still open. In Windows, if a file is requested to be deleted, it will only be deleted once the last handle to that file is closed, leaving the name visible in the file system until then. To support Linux unlink semantics, VolFs renames unlinked files to a hidden temporary directory before requesting deletion.» This is really good news. It seems that I have to evaluate WSL.