Path: utzoo!mnetor!uunet!cbmvax!andy From: andy@cbmvax.UUCP (Andy Finkel) Newsgroups: comp.sys.amiga Subject: Re: Device List and monitoring devices. Message-ID: <3372@cbmvax.UUCP> Date: 26 Feb 88 14:03:14 GMT References: <1475@sugar.UUCP> <43039@sun.uucp> Reply-To: andy@cbmvax.UUCP (Andy Finkel) Organization: Commodore Technology, West Chester, PA Lines: 38 Keywords: Details, details. AmigaDOS and crystal balls. In article <43039@sun.uucp> cmcmanis@sun.UUCP (Chuck McManis) writes: >In article <1475@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes: >With the same physical device? Well As far as I know the only way to >really do it is to compare the Locks of the two files. Note that locks >are supposed to be opaque things but I believe they should be comparable >much like pointers. If the files are the same physical file the locks >should match up. Caution: Locks are privately allocated structures. Don't go around copying them, or allocating them ,or.... use DupLock() for that. Locks for different handlers and filesystems may be of different sizes... So, with the caution out of the way, you can compare the fields you know about...DiskBlock, ProcessID, and VolNode. > >>If you call DeviceProc and don't do anything with the Lock returned in >>IoErr(), what happens to it? Does it leave a loose lock? Is it the ParentDir >>lock, or a root lock, or what? DeviceProc returns a pointer to a lock, rather than an actual lock itself. Nothing for you to UnLock. >>When you come across a DevList entry with Type equal to dt_volume, how >>do you map it to a physical volume ID? Go through the DevList looking >>for dt_device entries with the same Handler process? yes. That works nicely. -- andy finkel {ihnp4|seismo|allegra}!cbmvax!andy Commodore-Amiga, Inc. "Never test for an error condition you don't know how to handle." Any expressed opinions are mine; but feel free to share. I disclaim all responsibilities, all shapes, all sizes, all colors.