• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I know if a file is a system link?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How do I know if a file is a symbolic link? Was: system link
      • From: Jerry Krinock <email@hidden>
References: 
 >How do I know if a file is a system link? (From: "Alan Smith" <email@hidden>)
 >Re: How do I know if a file is a system link? (From: "Alan Smith" <email@hidden>)
 >Re: How do I know if a file is a system link? (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Unit testing and Xcode integration
  • Next by Date: Re: Unit testing and Xcode integration
  • Previous by thread: Re: How do I know if a file is a system link?
  • Next by thread: Re: How do I know if a file is a symbolic link? Was: system link
  • Index(es):
    • Date
    • Thread