• 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: Exclusive File Access
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exclusive File Access


  • Subject: Re: Exclusive File Access
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 21 Nov 2002 14:54:57 +0100

On Thursday, Nov 21, 2002, at 00:31 Europe/Prague, Rosyna wrote:

I'm talking about exclusive write access only.

With general document-editing applications, we are lucky there is nothing as that: again, it would be *QUITE* crippling.

I don't say there are no special apps which need it, but plain things like TextEdit definitely do not.

If another user opens a file already opened for write access, open it read-only.

Luckily, with standard document-based applications files are *NEVER* opened read-write.

(i) when *document* is opened, *file* is opened read-only, read into memory, and closed;
(ii) when document is saved,
(a) another file is *created* beside the original one, with the new contents;
(b) the original file is removed (or renamed to *~.*)
(c) the new file is renamed to the original name.

This is the *one* right way to do things for general document-based applications. Again, if you have special needs, you have a number of ways to fill them, but DON'T mess things up just for kicks.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.
References: 
 >Re: Exclusive File Access (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Two mnemonics in Cocoa
  • Next by Date: Re: placing windows behind finder icons
  • Previous by thread: Re: Exclusive File Access
  • Next by thread: Re: Exclusive File Access
  • Index(es):
    • Date
    • Thread