Page 1 of 1

Detection of "file has changed name" events?

Posted: 29 Aug 2022 00:33
by Jimw338
I notice in Apple applications, if I open a file, then change the name on the disk, the references in an application using it will also change - for example if I open a text file in TextEdit, type something, then switch to the Finder and rename it, then switch back to TextEdit and save it, it maintains connection to the file even though the name has changed. I assume if you do everything "The Cocoa/Swift Way"(TM Apple) this is all transparent. VLC doesn't seem to respect this - if I change the name of a file that I'm playing while it's playing, it will continue, but afterwards the playlist name doesn't change, nor can VLC find it again. I assume there is some event that an application can subscribe to (either a macOS event, or a signal in the underlying BSD).

Quickly Googling, I find the FSWatch library that implements this:

https://github.com/emcrisostomo/fswatch

Could this be added to VLC?

Re: Detection of "file has changed name" events?

Posted: 04 Sep 2022 21:50
by fkuehne
It could be added, but I do not see this happening shortly.

I like the Mac behavior a lot (you can even delete files while they are playing in VLC and playback continues..) and it is superior to Windows and Linux where you cannot even rename a file while it is open. However, in VLC, such a system level integration would need to be done quite deep in the core, which is hard to separate without being invasive with the other platforms that we support.