Re: Is a network file in use?
Re: Is a network file in use?
- Subject: Re: Is a network file in use?
- From: Walter Ian Kaye <email@hidden>
- Date: Sat, 27 Mar 2004 02:33:19 -0800
At 09:51a -0500 03/25/2004, Jones, Robert didst inscribe upon an
electronic papyrus:
I got around the problem of overwriting the info already in the file by
"read"ing the contents of the file to eof, then appending the new
information in a variable before "write"ing the whole thing back into the
file.
Which, if everyone accesses the file the same way, and the read/write
occurs reallyreallyreally fast, gives a 99.3% probability of no
corruption. ;)
The only glitch occurs when someone has the file open and they attempt to
save it after it has been modified via AppleScript. They get an error about
TextEdit not being able to save SimpleText files and they must provide a new
filename. Not so bad because it retains the data in the modified version of
the file, but bad for the operator because it could be confusing for them.
However, this doesn't happen very often (less than 1% of the time) so I'm
not too concerned.
But maybe things are different in Panther...
I think it's generally bad for a file to be open for writing
simultaneously by different users without an arbitrating server app
managing the access. Trying to manage it from the client side without
a server app managing it is just asking for trouble. You know how
this is often referenced wrt FileMaker? Same applies to all other
client apps.
This applies to MacOS access. Unix access using LOCK_EX would be much better.
Umm... isn't there a technote or something about locking differences
between Unix and MacOS? I recall reading something somewhere...
-boo
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.