Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!rutgers!cbmvax!andy From: andy@cbmvax.UUCP (Andy Finkel) Newsgroups: comp.sys.amiga Subject: Re: AmigaDOS locks Message-ID: <2140@cbmvax.UUCP> Date: Fri, 17-Jul-87 19:23:13 EDT Article-I.D.: cbmvax.2140 Posted: Fri Jul 17 19:23:13 1987 Date-Received: Wed, 22-Jul-87 02:34:59 EDT References: <798@goanna.oz> Reply-To: andy@cbmvax.UUCP (Andy Finkel) Organization: Commodore Technology, West Chester, PA Lines: 27 Keywords: locking files with amigados In article <798@goanna.oz> ajk@goanna.oz (Alan Kent) writes: >Please Enlighten me. > >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). > >When I open it, it may only be for read access, but I might want to >write to it later (to save a new version). The easiest way to do this is Open the file MODE_READWRITE (1004) You can read from it, write to it, whatever, and you have exclusive access. (As long as the file already exists, anyway. You can read from a file opened with MODE_NEWFILE, by the way) The names are actually slightly inaccurate...you can read from a file opened for write access with no problem. andy finkel -- andy finkel {ihnp4|seismo|allegra}!cbmvax!andy Commodore-Amiga, Inc. "The goal of Computer Science is to build something that will last at least until we've finished building it." Any expressed opinions are mine; but feel free to share. I disclaim all responsibilities, all shapes, all sizes, all colors.