• 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: RTFD file corruption
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RTFD file corruption


  • Subject: Re: RTFD file corruption
  • From: Jeff LaMarche <email@hidden>
  • Date: Wed, 31 Aug 2005 09:13:47 -0400


On Aug 31, 2005, at 8:17 AM, Jesse Grosjean wrote:

My application stores data in RTFD text files. That is a package note.rtfd/ that stores a text file TXT.rtf along with any attachments.

The problem is that recently a user sent me a document where these files were corrupted and would not open. In the end the corruption turned out to be very minor, the capitalization had changed on the internal text file to TXT.RTF. Changing it back to TXT.rtf fixed the problem.

I'm wondering if this is a problem that I could have caused and if there is something that I should be doing to avoid it. I save the text using RTFDFileWrapperFromRange and then save the filewrapper to disk. My guess is that the problem must have occurred when moving between different file formats, they use OS 10.3.9, 10.4, and an iPod shuffle to move the file between. Is there anything that I can do or suggest so that they won't run into this problem in the future.

I'm guessing that the problem is not actually in your application, but rather in the use of the iPod shuffle, which uses FAT32 (the "old" Windows file format). It is case insensitive, but is supposed to be case preserving (just like Classic Mac OS). So, for example, in FAT32, if you save a file as "hello.txt", and later asked it for "hello.TXT" it would happily give you the file.


No, even though FAT32 is SUPPOSED to be case preserving, I've found with my shuffle (and other thumb drives as well) that it is not. My files often end up in all caps, or at least the extension does. I'm not sure the reason, though it might have something to do with the dual file naming (IIRC - old style 8+3 files, plus the longer Joliet- style introduced in Win95 are stored separately, with the 8+3 filename being the actual filename, and the longer name being just a display name... but I could be wrong on this, I don't delve any further into Windows tech than I need to).

I think the only way you could do this would be to rename the inner file using all lowercase extension before trying to load it, or else subclassing NSAttributedString (?? or whichever class you're using) to work for either capitalization. Or, you could tell them it's "user error", though that's not going to be very satisfactory to your user since most end users don't know anything about this stuff, they just see it as a bug. =-(

Hope this helps.
Jeff

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: RTFD file corruption
      • From: Douglas Davidson <email@hidden>
References: 
 >RTFD file corruption (From: Jesse Grosjean <email@hidden>)

  • Prev by Date: Re: Problem with converting an NSImage to grayscale
  • Next by Date: Need Help Creating an OutlineView for TabView selection
  • Previous by thread: RTFD file corruption
  • Next by thread: Re: RTFD file corruption
  • Index(es):
    • Date
    • Thread