Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!cbmvax!phillip From: phillip@cbmvax.cbm.UUCP (Phillip Lindsay CATS) Newsgroups: comp.sys.amiga Subject: Re: AmigaDOS locks Message-ID: <1774@cbmvax.cbmvax.cbm.UUCP> Date: Mon, 27-Apr-87 16:28:08 EDT Article-I.D.: cbmvax.1774 Posted: Mon Apr 27 16:28:08 1987 Date-Received: Tue, 28-Apr-87 03:42:51 EDT References: <798@goanna.oz> Organization: Commodore Technology, West Chester, PA Lines: 29 in article <798@goanna.oz>, ajk@goanna.oz (Alan Kent) says: > Keywords: locking files with amigados > > Please Enlighten me. > > I have been looking through all the manuals I can lay my hands on, but > nothing seems to help. > > I want to lock a file so that no-one else will touch it while I do > I/O on the file (reads and possibly writes). ....[crunch] > At present, I exclusive Lock() the file and if that works, I quickly > UnLock() and Open() it. This is not perfect but its the best I can > think of. Anyone got any better ideas? > There is new Open() mode offered in the 1.2 release. (Look in the 1.2 "dos.h" header file). MODE_READWRITE = 1004 file = Open("foo",MODE_READWRITE); /* opens old file with exclusive lock */ -phil ============================================================================== Phillip (Flip) Lindsay - Commodore Business Machines - Amiga Technical Support UUCP: {ihnp4|seismo|caip}!cbmvax!phillip - Phone: (215) 431-9180 No warranty is implied or otherwise given in the form of suggestion or example. Any opinions found here are of my making.