Thread: Mac OS X aliases

  1. #1
    Registered User
    Join Date
    Aug 2008

    Mac OS X aliases

    Hi all,
    This question is specific to the Mac OS X platform. So Mac OS users please help.

    Mac OS X / HFS+ filesystem has aliases.

    How can I identify them through a program?
    I read that they are not understood through the CLI

    Can they be accessed using the POSIX API's and still retain their actual meaning?


  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    I've no idea.
    S_IFLNK would seem to be the closest thing to it. If that isn't it, you need an API specific to your OS.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Aug 2008
    It identifies the alias as a regular file and not a sym link

    I tried out a program using both S_ISLNK and S_ISREG

  4. #4
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Katy, Texas
    Are you using stat(), fstat() or lstat()? Methinks you need to be using lstat().
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  5. #5
    Registered User
    Join Date
    Apr 2008
    S_IFLNK only identifies _symbolic_ links, if it is a hard link then there is no difference between this link and the original file because there's no longer an original file, both entries are using the same inode.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mac OS X Users/C programmers?
    By petermichaux in forum C Programming
    Replies: 16
    Last Post: 04-18-2011, 06:36 AM
  2. Replies: 1
    Last Post: 02-03-2009, 04:45 AM
  3. inquiry from a hungry mac os x user
    By terabyter in forum C Programming
    Replies: 3
    Last Post: 06-23-2006, 09:04 AM
  4. Mac OS X Programming
    By Exile in forum A Brief History of
    Replies: 14
    Last Post: 05-06-2005, 03:12 PM
  5. Assembly & Mac OS X
    By kristy in forum Tech Board
    Replies: 2
    Last Post: 07-29-2003, 04:29 PM