Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ucla-cs!zen!ucbvax!ANDREW.CMU.EDU!rs4u+ From: rs4u+@ANDREW.CMU.EDU (Richard Siegel) Newsgroups: comp.sys.mac Subject: Locking Files under AppleShare Message-ID: Date: Wed, 29-Jul-87 08:04:13 EDT Article-I.D.: andrew.wV3SGxy00V4Iz3407n Posted: Wed Jul 29 08:04:13 1987 Date-Received: Fri, 31-Jul-87 02:32:49 EDT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 23 I'm working on an application that handles multiple data and resource files, as documents. In order for my Revert function to work safely, I have to somehow lock the files while they're open so that they can't get moved; if a file gets moved between the time that it's opened and the time that Revert is called, havoc can result. As it is now, I open the file (with FSOpen and OpenResFile), read whatever information I need (with FSRead and GetResource), and then close the file (with FSClose and CloseResFile). I need also to prevent a file from being opened twice, is there a way to do this? Simply leaving it open doesn't seem to work, and I definitely don't want to try to close the same access path twice -- doing so can have horrible consequences... Notice that the same considerations apply to an application that's runnning under Juggler... Any help would be appreciated. --Rich