问题
In the header stat.h on osx 10.7 I found define on fileflag UF_TRACKED. I googled that define but didn't find anything about flag. Can you describe me what does this flag mean? I encountered with it when I try to apply attributes to the file wich placed on the mounted folder. That folder is HFS+ folder on the remoted osx 10.7.3. Maybe I can ignore it? And what can happen in that case?
回答1:
The UF_TRACKED is a flag which tells HFS to send an event to a tracked file handler in user mode on any change to the file's dentry (i.e. rename or delete, and changes in metadata, but not file modification). You can see that both in the header file:
#define UF_TRACKED 0x00000040 /* file renames and deletes are tracked */
The code to handle this is in the kernel, bsd/hfs/hfs_vfsutils.c:
int
check_for_tracked_file(struct vnode *vp, time_t ctime, uint64_t op_type, void *arg)
{
int tracked_error = 0, snapshot_error = 0;
if (vp == NULL) {
return 0;
}
if (VTOC(vp)->c_bsdflags & UF_TRACKED) {
...
And is called all over the place, primarily from hfs_vnops.c
来源:https://stackoverflow.com/questions/10607877/uf-tracked-file-flag-from-stat-h