NSWorkspace.noteFileSystemChanged not working in macOS Catalina?

205 views
Skip to first unread message

mixtly

unread,
Jul 9, 2019, 4:11:50 AM7/9/19
to OSXFUSE
Did anyone test if noteFileSystemChanged works in macOS Catalina? For me, it doesn't refresh the Finder window content.

I use NSWorkspace.noteFileSystemChanged to update Finder window when underlying model is updated (ie new file appearance or rename).

Benjamin Fleischer

unread,
Jul 9, 2019, 1:30:02 PM7/9/19
to osxfus...@googlegroups.com
Have you tried using the notification API of FUSE instead? For low level file systems you can use

fuse_lowlevel_notify_inval_inode()
fuse_lowlevel_notify_inval_entry()
fuse_lowlevel_notify_delete()

For high level file systems use

fuse_invalidate_path()

For file systems using the Objective-C framework use

[GMUserFileSystem invalidateItemAtPath:error:]

Am 09.07.2019 um 10:11 schrieb mixtly <cica...@gmail.com>:

Did anyone test if noteFileSystemChanged works in macOS Catalina? For me, it doesn't refresh the Finder window content.

I use NSWorkspace.noteFileSystemChanged to update Finder window when underlying model is updated (ie new file appearance or rename).

--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-grou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osxfuse-group/7be596ab-c6cb-4eaf-a894-dacf9c2ab500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mixtly

unread,
Sep 16, 2019, 4:38:07 AM9/16/19
to OSXFUSE
I tried using [GMUserFileSystem invalidateItemAtPath:error:] to force Finder content refreshing but it didn't work. I still have to close and open folder to make new content appear. I tried it in combination with [NSWorkspace noteFileSystemChanged:path] but still no success. I'll try some more options.


уторак, 09. јул 2019. 19.30.02 UTC+2, Benjamin Fleischer је написао/ла:
Have you tried using the notification API of FUSE instead? For low level file systems you can use

fuse_lowlevel_notify_inval_inode()
fuse_lowlevel_notify_inval_entry()
fuse_lowlevel_notify_delete()

For high level file systems use

fuse_invalidate_path()

For file systems using the Objective-C framework use

[GMUserFileSystem invalidateItemAtPath:error:]

Am 09.07.2019 um 10:11 schrieb mixtly <cica...@gmail.com>:

Did anyone test if noteFileSystemChanged works in macOS Catalina? For me, it doesn't refresh the Finder window content.

I use NSWorkspace.noteFileSystemChanged to update Finder window when underlying model is updated (ie new file appearance or rename).

--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfus...@googlegroups.com.

mixtly

unread,
Sep 27, 2019, 2:53:02 AM9/27/19
to OSXFUSE
What work in the end is to modify the folder/file modification date.

id attribs = @{

        NSFileModificationDate: NSDate.date

};

NSError* error;

[SREG.fileManager setAttributes:attribs ofItemAtPath:path error:&error];


This results in setAttributes:ofItemAtPath: fuse callback where the new modificationDate is set on the relevant node. This also results in proper FS Events so new folder appears in Finder or its content gets refreshed.

Georgi Ivanov

unread,
Oct 9, 2019, 7:42:02 AM10/9/19
to OSXFUSE
Hi! We have the same problem in MacOS Catalina - the Finder notifications don't work anymore and until now we used noteFileSystemChanged. We're a high level distributed file system and, as you advise, we should use fuse_invalidate_path(). But this function takes a pointer to a fuse struct, which we can't see where to take from. We can see that it's created in the fuse_main, but we can't find how to retrieve it in order to call fuse_invalidate_path(). Can you tell us how to use it properly? And also, is it guaranteed that this will notify the OS (and the Finder in particular) about a change in the filespace?


On Tuesday, July 9, 2019 at 8:30:02 PM UTC+3, Benjamin Fleischer wrote:
Have you tried using the notification API of FUSE instead? For low level file systems you can use

fuse_lowlevel_notify_inval_inode()
fuse_lowlevel_notify_inval_entry()
fuse_lowlevel_notify_delete()

For high level file systems use

fuse_invalidate_path()

For file systems using the Objective-C framework use

[GMUserFileSystem invalidateItemAtPath:error:]

Am 09.07.2019 um 10:11 schrieb mixtly <cica...@gmail.com>:

Did anyone test if noteFileSystemChanged works in macOS Catalina? For me, it doesn't refresh the Finder window content.

I use NSWorkspace.noteFileSystemChanged to update Finder window when underlying model is updated (ie new file appearance or rename).

--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfus...@googlegroups.com.

Georgi Ivanov

unread,
Oct 17, 2019, 3:54:03 AM10/17/19
to OSXFUSE
Just a kind reminder, not to lose the question :) 

Georgi Ivanov

unread,
Nov 13, 2019, 6:20:33 AM11/13/19
to OSXFUSE
^^^

Georgi Ivanov

unread,
Dec 20, 2019, 7:06:22 AM12/20/19
to OSXFUSE
^^^

Benjamin Fleischer

unread,
Dec 20, 2019, 7:38:28 AM12/20/19
to osxfus...@googlegroups.com
Hi Georgi,

There are at least two options to get access to the fuse struct. You could implement fuse_main() yourself or you could call fuse_get_context() during a file system callback, e.g. init(), to get access to the fuse struct.

Best regards,
Benjamin

To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-grou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osxfuse-group/ae302c5e-9cb2-4882-9147-5fd5caeb3ea5%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages