• 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: Alias vs. Symbolic Link
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alias vs. Symbolic Link


  • Subject: Re: Alias vs. Symbolic Link
  • From: email@hidden
  • Date: Sat, 5 May 2001 17:11:20 -0700

On Saturday, May 5, 2001, at 05:02 PM, Steve Gehrman wrote:

is there a simple way or testing if a file is an alias? I don't need to
resolve it, just need to know if it's an alias or a regular file.

Try the following:

BOOL isAliasFile(const NSString* inPath)
{
BOOL result = NO;

// Get an FSRef from the path
FSRef fsRef;
OSStatus err = FSPathMakeRef([inPath fileSystemRepresentation],
&fsRef, NULL);
if (err == noErr)
{
// Get the FinderInfo for the file
FSCatalogInfo catalogInfo;
err = FSGetCatalogInfo(& fsRef, kFSCatInfoFinderInfo,
&catalogInfo, NULL, NULL, NULL);
if (err == noErr)
{
// Check the isAlias bit
FileInfo* info = (FileInfo*)&catalogInfo.finderInfo;
result = (info->finderFlags & kIsAlias) != 0;
}
}

return result;
}


  • Prev by Date: Re: Alias vs. Symbolic Link
  • Next by Date: NSBrowserCell subclasses
  • Previous by thread: Re: Alias vs. Symbolic Link
  • Next by thread: NSBrowserCell subclasses
  • Index(es):
    • Date
    • Thread