• 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: Resolving alias
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resolving alias


  • Subject: Re: Resolving alias
  • From: Nathan Day <email@hidden>
  • Date: Thu, 16 Jan 2003 15:49:35 +1030

I have this as a category of NSString

/*
* +stringWithFSRef:
*/
+ (NSString *)stringWithFSRef:(const FSRef *)aFSRef
{
UInt8 thePath[PATH_MAX + 1]; // plus 1 for \0 terminator

return (FSRefMakePath ( aFSRef, thePath, PATH_MAX ) == noErr) ? [NSString stringWithUTF8String:thePath] : nil;
}

/*
* -getFSRef:
*/
- (BOOL)getFSRef:(FSRef *)aFSRef
{
return FSPathMakeRef( [self UTF8String], aFSRef, NULL ) == noErr;
}

/*
* -resolveAliasFile
*/
- (NSString *)resolveAliasFile
{
FSRef theRef;
Boolean theIsTargetFolder,
theWasAliased;
NSString * theResolvedAlias = nil;;

[self getFSRef:&theRef];

if( (FSResolveAliasFile ( &theRef, YES, &theIsTargetFolder, &theWasAliased ) == noErr) )
{
theResolvedAlias = (theWasAliased) ? [NSString stringWithFSRef:&theRef] : self;
}

return theResolvedAlias;
}



On Wednesday, January 15, 2003, at 05:16 PM, Aidas Dailide wrote:

Hi!

I wonder, how could i resolve alias(not symbolink link). Looks like NSFileManager doesn't has this command.

Thanks,

Aidas
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Resolving alias
      • From: email@hidden
References: 
 >Resolving alias (From: Aidas Dailide <email@hidden>)

  • Prev by Date: Re: NSTableView modifications
  • Next by Date: Re: sending release to nil
  • Previous by thread: Re: Resolving alias
  • Next by thread: Re: Resolving alias
  • Index(es):
    • Date
    • Thread