Can dirhelper delete files in NSTemporaryDirectory() while app is running?
Can dirhelper delete files in NSTemporaryDirectory() while app is running?
- Subject: Can dirhelper delete files in NSTemporaryDirectory() while app is running?
- From: "Steve Shepard" <email@hidden>
- Date: Thu, 15 Jan 2009 10:41:30 -0800
Question:
It appears that dirhelper can delete files from NSTemporaryDirectory()
while an app is running. Is this a bug in
com.apple.bsd.dirhelper.plist, which specifies that dirhelper run
periodically?
Background:
I'm trying to track down a bug that a few users have reported but that
I can't reproduce. Console logs from these users indicate that files
that should be in a subdirectory of NSTemporaryDirectory() have been
deleted.
On Leopard, the command /usr/libexec/dirhelper is responsible for
cleaning out old files in /var/folders, which is a parent directory of
NSTemporaryDirectory().
According to /System/Library/LaunchDaemons/com.apple.bsd.dirhelper.plist,
dirhelper is run at launch and AT REGULAR INTERVALS AFTER THAT to
remove files that are more than 3 days old.
<key>RunAtLoad</key>
<true/>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>35</integer>
</dict>
<key>EnvironmentVariables</key>
<dict>
<key>CLEAN_FILES_OLDER_THAN_DAYS</key>
<string>3</string>
</dict>
(Note: You can find the dirhelper source at
http://www.opensource.apple.com/darwinsource/10.5.6/system_cmds-433.4/dirhelper.tproj/)
If an app creates files in NSTemporaryDirectory() and the user leaves
the app running for more than 3 days (or unzips an archive containing
files with a modification date more than three days in the past), the
files will be deleted out from under the application ... won't they?
-Steve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden