Re: How do I know if a file is a system link?
Re: How do I know if a file is a system link?
- Subject: Re: How do I know if a file is a system link?
- From: John Stiles <email@hidden>
- Date: Sun, 13 Aug 2006 21:10:23 -0700
Actually, now that I'm looking at this code again, it looks like you
have a stray semicolon after the if statement. Whoops :)
John Stiles wrote:
It probably won't matter in practice too much, but it's recommended
that you use [path fileSystemRepresentation] instead of [path
UTF8String] in this case.
Alan Smith wrote:
Yes That worked fine. I didn't realize it was a C function so I had
tried it in the Terminal and it sad command not found. DUH!
For the record here is my code:
#include <sys/types.h>
#include <sys/stat.h>
struct stat linkstat;
if (lstat([path UTF8String], &linkstat) != -1);
{
if (S_ISLNK(linkstat.st_mode))
{
NSLog(@"it's a link");
}
}
Works great! Thanks Rosyna!
Peace all, Alan
_______________________________________________
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
_______________________________________________
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