|
|
Subscribe / Log in / New account

Ubuntu on Windows

Ubuntu on Windows

Posted Mar 31, 2016 8:08 UTC (Thu) by sourcejedi (guest, #45153)
In reply to: Ubuntu on Windows by Cyberax
Parent article: Ubuntu on Windows

Actually even Win32 allows deleting open files, if they were opened with the flag FILE_SHARE_DELETE.


to post comments

Ubuntu on Windows

Posted Mar 31, 2016 8:13 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link] (4 responses)

Unfortunately, it's not as easy.

FILE_SHARE_DELETE means that the file can be opened with DELETE_ON_CLOSE mode, meaning it'll be deleted once all open handles for this file are closed. I don't think it's possible to do it otherwise.

Ubuntu on Windows

Posted Apr 4, 2016 20:38 UTC (Mon) by Wol (subscriber, #4433) [Link] (3 responses)

Shame they can't do what Pr1mos did ... they had the same problem with "how do we replace open files when upgrading the Operating System". (Or when recompiling, or whatever.)

What it did was rename open files to some weird (but standard) name and put the new file in its place. So every now and then you ran a clean-up on all files with this standard filename layout and deleted them.

The thing about Windows that really gets me, though, is when damn background processes I don't want open files I want to access, and lock the file/directory. I typically copy directories off my camera, and the first thing I do is rename the directory - that is - if I can - if Windows hasn't damn well locked it first ...

Cheers,
Wol

Ubuntu on Windows

Posted Apr 6, 2016 20:52 UTC (Wed) by nix (subscriber, #2304) [Link] (2 responses)

This is the same kludge NFS servers usually use. Not for nothing is it called 'silly-rename' in the Linux implementation.

Ubuntu on Windows

Posted Apr 6, 2016 23:42 UTC (Wed) by anselm (subscriber, #2796) [Link] (1 responses)

The silly renaming in NFS is necessary in order to maintain Unix file semantics on a (supposedly) stateless NFS server. In Unix, you can open a file and unlink it immediately afterwards, but as long as the process keeps the file open it can still use it even though the file doesn't have a name in the file system anymore. The NFS server, being stateless, doesn't keep track of which files a client has opened. Hence the NFS server must rename the file instead of deleting it outright, in order to be able to find it again when a client which might still have it open (from its POV) accesses it later, even though the file's original name may already be in use for a completely different file. It is silly but there is really not a lot to be done about it.

Ubuntu on Windows

Posted Apr 12, 2016 16:18 UTC (Tue) by nix (subscriber, #2304) [Link]

I didn't mean to imply it wasn't essential, and indeed I use it all the time. But that doesn't mean that it's any less silly :)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds