Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!uniol!Marco.Eichelberg From: Marco.Eichelberg@arbi.informatik.uni-oldenburg.de (Marco Eichelberg) Newsgroups: comp.lang.pascal Subject: Re: Share Message-ID: <6060@uniol.UUCP> Date: 28 Jun 91 11:43:22 GMT References: Organization: University of Oldenburg, Germany Lines: 32 lion@dat1hb.north.de (Daniel Tietze) writes: > I have a question about using SHARE (as supplied with MS-DOS) with >Turbo Pascal programs. How can I check SHARE violations in my program? >What exactly does SHARE do when it encounters a sharing violation? I >believe the IOResult is set to an appropriate value, but I don't >know exactly which result is to be expected. [...] The only "interface" from TURBO-PASCAL to SHARE.EXE is the global variable FILEMODE. The default is FileMode=2, which means "exclusive read/write". By setting this variable to a appropriate value (i don`t have my manuals with me, so I can`t tell you right now) you can open a variable for "multiple read" or even "multiple read/write" access and enable multi-user processing (at least on LANs). If share finds a access violation, you will simply get a DOS error code (IOResult=62 ??). You could trap this using {$I-}, or else you will get a runtime error. You have to program multiple retries to locked files yourself, DOS does not care about this. Hope this helps. Best Regards -- ========================================================================= Marco Eichelberg, Auf dem Braakland 3, D-W2875 Bookholzberg, Germany Phone: +49 4223 2726 (08.00 - 18.00 MET) UUCP : eichelberg@uniol.uucp Fax : +49 4223 8322 ZNet : eichelberg@uniol.zer Inhouse : meichel!faramir Bitnet: 249565 AT DOLUNI1 Domain (Internet) : Marco.Eichelberg@arbi.informatik.uni-oldenburg.de =========================================================================