Skip navigation.
 
mlRe: Exclusive File Access
FROM : Ondra Cada
DATE : Thu Nov 21 14:54:57 2002

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_removed>              http://www.ocs.cz
private        <email_removed>            http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlExclusive File Access Donald Brown Nov 19, 20:38
mlRe: Exclusive File Access Ondra Cada Nov 20, 14:36
mlRe: Exclusive File Access Cameron Hayne Nov 20, 17:08
mlRe: Exclusive File Access Donald Brown Nov 20, 20:49
mlRe: Exclusive File Access Rosyna Nov 20, 22:00
mlRe: Exclusive File Access Ondra Cada Nov 20, 22:19
mlRe: Exclusive File Access Rosyna Nov 20, 23:25
mlRe: Exclusive File Access Michael Norris Nov 21, 00:21
mlRe: Exclusive File Access Ondra Cada Nov 21, 00:29
mlRe: Exclusive File Access Rosyna Nov 21, 00:31
mlRe: Exclusive File Access Ondra Cada Nov 21, 00:32
mlRe: Exclusive File Access Malte Tancred Nov 21, 12:07
mlRe: Exclusive File Access mw Nov 21, 12:28
mlRe: Exclusive File Access Malte Tancred Nov 21, 13:47
mlRe: Exclusive File Access Ondra Cada Nov 21, 14:54