Re: File level action protocol
Re: File level action protocol
- Subject: Re: File level action protocol
- From: Mike Smith <email@hidden>
- Date: Fri, 15 Jul 2005 10:10:24 -0700
On Jul 9, 2005, at 12:50 AM, Thomas Tempelmann wrote:
If the delayed notification is acceptable, how long a delay can you
tolerate?
Several seconds are no problem.
Ok. It sounds like the asynchronous interface that Spotlight uses
will probably be your best bet.
lookup passes a parent object and a name fragment to a
filesystem and gets back a child object or an error.
You can also look up by a file ID instead of parID+name, right?
So, all I need is to know a file's ID for my project.
On some filesystems, yes.
Lookups performed by fileid may not have a meaningful parent
identifier at all
On HFS+, they do, and that's all I care about.
But you want to know about "all" files, and there may be many files
*not* on HFS+
As long as I can learn the File ID while I do the recording, I should
be fine.
The interfaces available to you use paths, not File IDs. You can
translate
these, but again be aware that some volume formats do (can) not support
persistent File IDs.
The file handle is not relevant at the layer you're interested in;
it's a per-process association between a descriptor number and a
vnode.
So, what I need then is a (later) association between a vnode and a
File ID.
Path.
Isn't the Vnode identified by a unique number that is, like the dir
and file ID, remaining constant as long as its file/dir exists? Can
I record this vnode number when I get a "file change" notification?
If you're using the spotlight-style interface, you'll get a path which
can be converted in user space to a File ID. On the KAUTH-based
interface, you can fetch a path for the vnode.
Because File IDs are (can) not be ubiquitous, the kernel doesn't use
them;
it has some mechanisms for looking things up by ID, but they're not
otherwise
useful.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden