Detection of "file has changed name" events?

macOS specific usage questions
Jimw338
New Cone
New Cone
Posts: 2
Joined: 06 Nov 2021 16:32

Detection of "file has changed name" events?

Postby Jimw338 » 29 Aug 2022 00:33

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?

fkuehne
Developer
Developer
Posts: 7241
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

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

Postby fkuehne » 04 Sep 2022 21:50

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.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 15 guests