"Internal workings" is vague: which level of "internals" are we
talking about? Sounds like you are interested in the Objective-C
bindings. These bindings sit atop the C bindings. The C bindings talk
to the kernel through system calls, where the "real" stuff happens.
So, as you see, there are several "internals".
Logging the kernel happenings would require you to compile your own
MacFUSE kernel extension. You'll need to enable one or more *_TRACE
macros in core/10.x/fusefs/fuse.h. This can provide extremely verbose
and utterly incomprehensible output that could be very hard to
correlate to end-user-visible actions.
You can mount your file system with the "-d" option to make it log the
C bindings' debug output. If you run the LoopbackFS Objective-C
example "manually" (from the command line), you should see this debug
output:
$ ./LoopbackFS.app/Contents/MacOS/LoopbackFS
...
If you are on Leopard, you can use DTrace to log Objective-C messages
(method invocations) on the class of interest. Again, using LoopbackFS
as an example, here's a sample DTrace script:
#pragma D option quiet
objc$1:LoopbackFS:*:entry
{
printf("[%s %s]\n",
copyinstr(*(uint32_t*)copyin(*(uint32_t*)copyin(arg0, 4)
+ 8, 4)),
copyinstr(arg1)
);
}
Suppose the script is in a file called loopbackfs.d. Run LoopbackFS
from the command line, *with* the environment variable
DYLD_SHARED_REGION set to the value "avoid". That is (the syntax will
not work with all shells):
$ DYLD_SHARED_REGION=avoid ./build/Release/LoopbackFS.app/Contents/
MacOS/LoopbackFS
...
Then, run dtrace with the aforementioned script, giving it the process
ID of LoopbackFS:
$ ps
...
18777 ttys002 0:00.65 ./build/Release/LoopbackFS.app/Contents/MacOS/
Loopback
...
$ sudo dtrace -s loopbackfs.d 18777
...
As file system activity occurs, you should see something like the
following:
[LoopbackFS attributesOfItemAtPath:error:]
[LoopbackFS attributesOfItemAtPath:error:]
[LoopbackFS attributesOfFileSystemForPath:error:]
[LoopbackFS contentsOfDirectoryAtPath:error:]
[LoopbackFS readFileAtPath:fileDelegate:buffer:size:offset:error:]
[LoopbackFS releaseFileAtPath:fileDelegate:]
[LoopbackFS openFileAtPath:mode:fileDelegate:error:]
...
Finally, everything is open source. Make use of that! You can add your
own custom debugging messages to anything you want. What more could
one possibly need to know "what gets called when I do xyz"?
Amit
On Aug 28, 12:16 pm, Jason8 <[EMAIL PROTECTED]> wrote:
> Hi:
>
> Can someone help me understand the internal workings of MacFUSE when a
> drag and drop happens. It looks like openFileAtPath will open the
> file, but I don't see how it gets read and eventually written to the
> dropped file.
>
> Looks like it might go openFileAtPath ->
> GMMutableDataBackedFileDelegate -> ?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---