Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'More elegant and space-saving!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
More elegant and space-saving!
Authored by: Palijn on Jul 03, '02 09:09:09AM
If you want to save the space that you use when copying the files in the above method, just use "ln" instead of "cp" .

Note that you MUST swap the destination and source arguments for this to work (the opposite of the "cp" syntax).

This creates hard links to the files, effectively letting you (or iPhoto) access them from the directory you want.
Note that a file is deleted from the filesystem only when all hard links reffering to it are deleted!

As this was used to duplicate a pictures library, I thought it could be useful to some to avoid duplicating the space used on the disk. By the way, since no data is moved by "ln", it is incredibely faster! :-)

HTH--Palijn

[ Reply to This | # ]
Correction to the above
Authored by: Palijn on Jul 04, '02 07:24:46PM
Well, folks, I hate to admit it, but I must have drunk a bit too much that day when I wrote the comment.
Actually, the whole method is still valid and much more space- and time-efficient than copying the files.
The thing that is false is, you don't have to invert the "cp" arguments.
Anyway, a quick inspection on the man ln page would already have corrected my preceding note on that point! :-)
Cheers
Palijn



[ Reply to This | # ]