At 6:47 PM -0500 2/1/03, Dan Mills wrote:
My next step will be to make temporary rtf files at run time.
Sounds reasonable, but there's a caveat.  You don't want to allow a
"race condition" between the writing and reading processes; if the
reader outruns the writer, it'll see a premature EOF.

There are a couple of approaches to this.  You can "roll your own"
by creating and then renaming (i.e., moving to a new name on the
same file system) the file.  I have an article on this approach
coming out in MacTech.

Alternatively, you can use the OSX Foundation facility for creating
files in an atomic manner (I think they may be using the first
technique, but they don't say and it doesn't really matter...).


I think you might want to look at these instance methods:

  writeToFile:atomically
  writeToURL:atomically

under the Foundation's NSArray and NSDictionary classes.

-r
--
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com/rdm    - my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc     - Prime Time Freeware's Darwin Collection

Reply via email to