Cannot set date of a symlink using FSSetCatalogInfo()?
Cannot set date of a symlink using FSSetCatalogInfo()?
- Subject: Cannot set date of a symlink using FSSetCatalogInfo()?
- From: James Bucanek <email@hidden>
- Date: Mon, 20 Mar 2006 23:39:49 -0700
Here's my conundrum:
I'm writing a document archiving and backup utility and I'm having some difficulty restoring symbolic link files. Here's the problem.
(1) I create a plain file and write the contents of the symbolic link.
(2) As long as the file is a regular file, I can use FSSetCatalogInfo to change it's permissions, modification date, etc.
(3) As per bug 2796751, I then use FSpSetFInfo() to change the file to a symbolic link by setting it's type/creator to 'slnk'/'rhap'.
(4) Once it is a symbolic link[1], I can no longer use FSSetCatalogInfo() to set its modification or creation dates. I can, however, use FSSetCatalogInfo() to set other aspects of the file, such as its owner and group IDs.
The kicker is that FSpSetFInfo() touches the file! If I set the file's modification and creation date in step 2, it works. But as soon as I change it into a symlink its modification date gets changed to today and I can't set it anymore.
Is this a know bug? Does anyone know of a workaround?
[1] I also ran into another bug/oddity: Once you chage a file into a symlink, the FSRef for the file is no longer usable for much of anything. The solution is to generate a new FSRef for the file following the call to FSpSetFInfo().
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden