3 ms·
or the file manager showing when files are open On Windows and Linux this is not difficult, I believe; the functionality is already present in things like http
by userbinator 5y ago
or the file manager showing when files are open
On Windows and Linux this is not difficult, I believe; the functionality is already present in things like https://docs.microsoft.com/en-us/sysinternals/downloads/handle https://docs.microsoft.com/en-us/sysinternals/downloads/hand... and lsof.
- pjerem 5y agoAgain, it depends on how the application accessing the file is developed. If your program just read to copy in memory then closes the file, waiting for the next save to reopen it, the OS can’t know on which file you are working. And this, i think, must be a pretty common implementation.
- userbinator 5y agoIf it closes the file, then it wouldn't be an open file?
- ghusbands 5y agoHere, I think "open" means "being worked on in some app", rather than "has an active file handle".
- grumbel 5y agoYou can use inotify to figure out what files are opened, closed or when they are written too. Can be used for example to indicate active file downloads in the file manager. However I don't think that's quite enough, as most apps will close the files again after they have read them. There is no need to keep them open, as you are working on their in-memory representation, not on the file on the disk until you hit 'Save'. So this seems more like a desktop level feature similar to "Recent Files", where the apps has to manually announce what it is doing instead of relying on low level file operations to figure it out.