• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Cannot set date of a symlink using FSSetCatalogInfo()?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Cannot set date of a symlink using FSSetCatalogInfo()?
      • From: James Bucanek <email@hidden>
  • Prev by Date: Re: C Strings
  • Next by Date: Re: Installer
  • Previous by thread: Re: CD: Predicate Builder - specifying NULL relationship
  • Next by thread: Re: Cannot set date of a symlink using FSSetCatalogInfo()?
  • Index(es):
    • Date
    • Thread