On 6/3/07, Hamish Allan <[EMAIL PROTECTED]> wrote:

> I know you already said that the
> Finder won't recognise any MacFUSE file system as supporting kqueue,
> but it might be possible to hack around this (e.g. a daemon monitoring
> fsevents and sending FNNotify / noteFileSystemChanged: notifications).

FYI, I have since confirmed this to be the case with a small patch to
gfslogger 0.9 (enclosed at the end of this email).

I tested it by touching/rming files on an EncFS filesystem using
Terminal and watching them appear and disappear in a Finder window.

This patch works if you create a new Cocoa application and overwrite
main.m with the patched gfslogger.c. It doesn't work if you just "gcc
-framework AppKit main.m".

Because it has to be run as root to access fsevents, some care must be
taken integrating it with MacFUSE filesystems. Apple recommend linking
a setuid tool with as few frameworks as possible; it would probably be
best to have some setuid code listening to fsevents and forwarding any
paths changed via a low-level mechanism such as Mach ports to some
non-setuid code which turns them into NSWorkspace notifications.

This sort of thing might be a candidate for inclusion into MacFusion
and/or FuseObjC, using the Security Framework to authenticate for
making the tool setuid. There should probably be some authentication
between them and the setuid tool, to prevent just anyone from getting
notification about changes to the filesystem. I'm a bit busy to be
learning a new framework at the moment but I will get round to it
eventually if nobody else takes it on.

Hamish


*** gfslogger.c Sun Aug  7 06:38:50 2005
--- main.m  Sun Jun  3 23:42:08 2007
***************
*** 1,3 ****
--- 1,5 ----
+ #import <Cocoa/Cocoa.h>
+
  /*
  
###############################################################################
  #
         #
***************
*** 70,75 ****
--- 72,79 ----
    signed char event_list[FSE_MAX_EVENTS];
    fsevent_clone_args retrieve_ioctl;

+     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
    event_list[FSE_CREATE_FILE]         = FSE_REPORT;
    event_list[FSE_DELETE]              = FSE_REPORT;
    event_list[FSE_STAT_CHANGED]        = FSE_REPORT;
***************
*** 105,110 ****
--- 109,116 ----
      process_event_data(large_buf, n);
    }

+     [pool release];
+
    return 0;
  }

***************
*** 198,202 ****
--- 204,210 ----

        switch(argtype) {
        case FSE_ARG_VNODE:
+       [[NSWorkspace sharedWorkspace] noteFileSystemChanged:[NSString
stringWithCString:(in_buf + pos)]];
        printf("    VNODE%11d  path   = %s\n", arglen, (in_buf + pos));
        break;
        case FSE_ARG_STRING:

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"macfuse-devel" 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-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to