Thread: Mac OS X aliases

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    22

    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?

    Thanks..

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    I've no idea.
    http://kernel.org/doc/man-pages/onli...n2/stat.2.html
    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
    Posts
    22
    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
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Are you using stat(), fstat() or lstat()? Methinks you need to be using lstat().
    Mainframe assembler programmer by trade. C coder when I can.

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    396
    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 Cprogramming.com
    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