Hi there,

I forgot to note that when I configure the Filesystem with the

      detachNewThread:YES option, the notification works. What exactly
does GMUserFilesystem with this option?

To my understanding, if I opt NO, all code should run in the main
thread, which should be the place, notifications would be delivered
to.
If I opt YES, UserFS would run in a new thread, which is NOT the main
thread, which should not receive notifications...

I am not able to run the UserFS in another thread because I use an
additional framework which is not threadsave and thus, not running
well with the opt YES.

Thanks for replies,

Mike

On Jan 21, 7:28 pm, Michael Ruepp <[email protected]> wrote:
> Hi there,
>
> my filesystem is based on the Macfuse Obj-C Command Line Filesystem Template.
>
> I need to use NSWorkspace Notifications and NSDistributed Notification Center 
> inside my User_Filesystem.m (I initialize the Observer in the initWithXXX 
> Section of my User_FS like this:
>
>                 //Notification Center for receiving mount notifications
>                 //theRepoHandler = [[RepoHandler alloc]init];
>
>                 [[[NSWorkspace sharedWorkspace] notificationCenter] 
> addObserver:self selector:@selector( didMount: )
>                                                                               
>                                                      
> name:NSWorkspaceDidMountNotification object:nil];
>                 [[[NSWorkspace sharedWorkspace] notificationCenter] 
> addObserver:self selector:@selector( didUnmount: )
>                                                                               
>                                                      
> name:NSWorkspaceDidUnmountNotification object:nil];
>
> I created two corresponding Methods.
>
> - (void)didMount:(NSNotification *)notif
> {
>         ALog(@"Hey someone mounted something at %@", [[notif userInfo] 
> objectForKey:@"NSDevicePath"] );
>
> }
>
> - (void)didUnmount:(NSNotification *)notif
> {
>         ALog(@"Hey someone unmounted something at %@", [[notif userInfo] 
> objectForKey:@"NSDevicePath"] );
>
> }
>
> However, I never received any notification.
>
> Funny, when I use the Objective-C Filesystem (Read/Write) template, 
> everything works fine.
>
> Thanks a lot,
>
> Mike

-- 
You received this message because you are subscribed to the Google Groups 
"MacFUSE" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/macfuse?hl=en.

Reply via email to