Re: Symbolic Links in Snow Leopard
Re: Symbolic Links in Snow Leopard
- Subject: Re: Symbolic Links in Snow Leopard
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 7 Sep 2009 07:55:51 +0700
On 7 Sep 2009, at 06:53, Greg Guerin <email@hidden> wrote:
Gerriet M. Denkmann wrote:
This is the directory used (/Volumes/à’•à¸¡à’√à¸˙/
Users/gerriet/
Downloads):
-rw-r--r--@ 1 gerriet staff 36 6 Sep 19:30 abc
-rw-r--r--@ 1 gerriet staff 47908 6 Sep 19:37 abc alias
lrwxr-xr-x 1 gerriet staff 3 4 Sep 21:31 abcSymlink -> abc
lrwxr-xr-x 1 gerriet staff 49 6 Sep 19:45 absAbsSymlink -> /
Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/Downloads/abc
Here is my code:
NSLog(@"%s start \"%@\"",__FUNCTION__, pat1);
NSString *pat2 = [ pat1 stringByTrimmingCharactersInSet:
[ NSCharacterSet whitespaceAndNewlineCharacterSet ] ];
NSLog(@"%s removed white: \"%@\"",__FUNCTION__, pat2);
NSString *pat3 = [ pat2 stringByStandardizingPath ];
NSLog(@"%s standardized \"%@\"",__FUNCTION__, pat3);
And this is the result:
start "/Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/Downloads/
absAbsSymlink"
removed white: "/Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/
Downloads/
absAbsSymlink"
standardized "/Volumes/à’•à¸¡à’√à¸˙/Users/gerriet/
Downloads/
absAbsSymlink" <-- BAD
Try using a pathname that contains only Latin alphabet characters
(for reference, the original chars of the volume-name are Thai: \u0e40
\u0e21\u0e48\u0e19). If necessary, create and mount a disk-image in
order to get only Latin chars.
Did try already - same issue.
Also, please show the code that assigns a value to pat1. How that
pathname is determined may have a bearing on the problem.
Same problem if I just do: pat1 = @"/Volumes/เม่น/Users/gerriet/
Downloads/absAbsSymlink";
Finally, I'm a little puzzled why stringByTrimmingCharactersInSet:
should be needed.
The string comes from the Services Menu and the user might have
selected more than the pathname (yes, this will break if the last path
component ends with whitespace, but this is kind of unlikely).
Kind regards,
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden