| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I'm monitoring an Adobe Illustrator file for changes using a kqueue. When saving a file, Illustrator first renames that file, then creates a new file with the original filename/path, and finally deletes the old, renamed file. Fine.
So I get a rename notification, and then I get a delete notification, but I will not get a subsequent write notification on the old path when the new file is written, presumably because kqueue monitors file descriptors and the new file has a new file descriptor. Fine.
I'm currently removing the old fd from the kqueue, re-adding the new fd to my kqueue, and then running my "file modified" code. This works, and is safe according to this message post: http://lists.apple.com/archives/darwin-development/2004/Feb/msg00075.html
Here's the problem: the file Illustrator renamed is never removed. I know Illustrator is calling unlink() after the rename, because that's what causes the delete notification to be sent according to the kqueue man page. However, after I terminate my program, the file remains. I'm assuming that because kqueue had an open file descriptor (or something similar down in the kernel), it prevented the file from being truly removed while the kqueue was running. Okay, then once I close the kqueue and the fd, the file should then have no further kernel references and be deleted, right?
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden This email sent to email@hidden
| References: | |
| >file monitored by kqueue isn't deleted (From: Eric Ocean <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.