• 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
Resource file length?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resource file length?


  • Subject: Resource file length?
  • From: Randall Meadows <email@hidden>
  • Date: Fri, 2 Apr 2004 12:13:43 -0500

To find out the length of the resource fork of a file, I'm using

NSString *rsrcFork = [fileName stringByAppendingPathComponent:@"rsrc"];
NSFileManager *fileMgr = [NSFileManager defaultManager];
if ([fileMgr fileExistsAtPath:rsrcFork]) {
NSFileWrapper *wrapper;
unsigned long long rsrcLength = 0;

wrapper = [[NSFileWrapper alloc] initWithPath:rsrcFork];
rsrcLength = [[wrapper fileAttributes] fileSize];
[wrapper release];
}

Is that the "approved" way? Or is there a better method?

[And yes, I really have to deal with resource forks; I'm working with legacy files...]

Thanks!
randy
_______________________________________________
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: Resource file length?
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: Re: Altering attributes of hyperlinked text
  • Next by Date: Re: Full screen borderless window
  • Previous by thread: Re: Design Q: custom control or Matrix?
  • Next by thread: Re: Resource file length?
  • Index(es):
    • Date
    • Thread