• 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: David Remahl <email@hidden>
  • Date: Fri, 17 Jan 2003 13:49:38 +0100

Hmm...I was thinking...

Would it even be possible to do this in a backwards compatible way? I mean, if one made a XXFSRef class (XX indicating that it doesn't have to be Apple sanctioned) that is a subclass of NSString, which really just forwards all string related method calls to the path of the file which it represents...

That way, it would be possible to do something like this:

NSImage *myImage; // this exists
XXFSRef *ref = [[XXFSRef alloc] initWithPath:@"/path/to/afile.tiff"];

NSLog( @"%@", ref ); // since ref is a subclass of NSString, this will log /path/to/afile.ext

/* At this point, the user _moves_ the file! /path/to/afile.tiff is no longer current
However, the ref can adapt to that */

NSLog(@"%@", ref); // this logs the _new_ path to afile.tiff!

[[myImage TIFFRepresentation] writeToFile:ref atomically:NO]; // this writes the image to the new location

What do you think? Has anyone implemented something along those lines?

/ Regards, David Remahl

On Friday, January 17, 2003, at 01:30 PM, email@hidden wrote:

Wouldn't it be better to create something equivalent to an NSFSRef which could be used in place of an NSString? If you convert an FSRef to an NSString you've made the implicit assumption that the file path is constant and may get a rude surprise if it isn't.
_______________________________________________
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: 
 >Re: Resolving alias (From: email@hidden)

  • Prev by Date: Re: Resolving alias
  • Next by Date: cocoa-java problem
  • Previous by thread: Re: Resolving alias
  • Next by thread: Re: Resolving alias
  • Index(es):
    • Date
    • Thread