symbolic link - How can I create hardlinks to an OSX bundle? Or the symlinks inside the bundle?

07
2014-04
  • Richard

    I have a hierarchy of files that I need to hardlink to a temporary install location. Some of those files are frameworks. Frameworks are bundles but essentially just folders, which aren't supported by ln (in bash, at least). For frameworks to properly be identified as such, they need a Resources folder at the top level (or, in my case, a symlink to one).

    Is there a way to hardlink wholesale to the framework bundle that I'm missing?

    Is there a way to translate the symlinks inside the source bundle to a target destination? On unix it would appear ln --physical does what I want, but that isn't supported on OSX. Are there any alternatives?

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    osx - How do sparse bundles get corrupted and can they be fixed?
  • Thilo

    I am warming up to Mac OS X sparse disk image bundles: This is a virtual file system stored as a collection of small (up to 8MB) files in a folder. This way, you can have encrypted HFS+ volumes stored on FAT-formatted USB drives, or SMB network shares. And because the data is broken up into 8MB chunks, incremental backups work very well by just copying the updated fragments. No problem for rsync or Time Machine, even for encrypted data.

    But even though this format seems to have been designed with compatibility with non-Mac tools and file systems in mind, it does not seem to work for example with Dropbox. Why is that? Is it just some meta data ("bundle flag?") that gets lost in transfer (and that I could manually put back in)?

    The Internet is also full of horror stories of corrupted bundles on Apple's own Time Capsule network backup device.

    How do these bundles get corrupted and what are my recovery options?


  • Related Answers
  • mralexgray

    As far as I know, you can mount the .sparseimage, and run "Repair/Verify" in Disk Utility, like you could on any other disk....

    And like any other disk, always try to "eject" or dismount before powering off or restarting the computer..

    I have seen them get corrupted before, but not for a long time... I think it might have been a non-Snow Leopard issue. BTW, sparse "disks" are how Apple stores your "Home" folder when you use FileVault (which are gone in Lion, so don't go ecrypting your home folder, now... they just encrypt the whole disk)

    My favorite command is the following, which shrinks the sparseimage down to the actual amount of data you have stored in it, no matter how large it had grown to by adding files which you have now deleted..

    hdiutil compact /Macintosh\ HD/Path/to/Name\ of\ file.sparseimage

    BTW, the backslashes ( \ ) are only required if you have spaces in your file pathname.