Mac OS X aliases

This is a discussion on Mac OS X aliases within the C Programming forums, part of the General Programming Boards category; Hi all, This question is specific to the Mac OS X platform. So Mac OS users please help. Mac OS ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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
    Katy, Texas
    Posts
    2,309
    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
    Posts
    395
    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, 07: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, 10:04 AM
  4. Mac OS X Programming
    By Exile in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-06-2005, 04:12 PM
  5. Assembly & Mac OS X
    By kristy in forum Tech Board
    Replies: 2
    Last Post: 07-29-2003, 05:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21