Re: SymLink duplicating troubles
Re: SymLink duplicating troubles
- Subject: Re: SymLink duplicating troubles
- From: Charles Srstka <email@hidden>
- Date: Sat, 11 May 2002 18:44:33 -0500
On Saturday, May 11, 2002, at 06:39 PM, Lorenzo Puleo wrote:
on 5/12/02 12:12 AM, Charles Srstka at email@hidden wrote:
On Saturday, May 11, 2002, at 04:55 PM, Lorenzo Puleo wrote:
Hi,
I have some trouble duplicating symLinks.
I would like to obtain an exact copy of a symLink, that is same
original
target, same size, same owner, same permissions, same creation,
modification
and backup date and locked flag. But what is working properly for
files, is
not working for symLinks. Why?
1) ==============
I copy the symLink "sourceSymLink" to the
not yet existing destination symLink "destSymLink" this way:
[manager createSymbolicLinkAtPath:destSymLink
pathContent:[sourceSymLink
stringByResolvingSymlinksInPath]];
It creates a symLink pointing to the target file properly. It works,
but the
original symLink "sourceSymLink" is 24 bytes
while "destSymLink" is 81 bytes. (!)
Why not just use -[NSFileManager copyPath: toPath:] ?
It produces a kind of alias-folder pointing to nothing. It doesn't work.
But I suppose you could use [manager
createSymbolicLinkAtPath:destSymLink pathContent:[manager
pathContentOfSymbolicLinkAtPath:sourceSymLink]];
[manager pathContentOfSymbolicLinkAtPath:sourceSymLink]
gives a relative path, it should be converted in an absolute path.
Ah. In that case, the new symlink is going to have a larger size if you
make it this way, because the absolute path will be longer than the
relative path.
I have no idea what the answer to your second question is, though.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.