home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!darwin.sura.net!mips!mips!decwrl!csus.edu!netcomsv!mork!davids
- From: davids@netcom.com (Dave Schreiber)
- Subject: Going from volume lock to device name
- Message-ID: <rfmmkdp.davids@netcom.com>
- Date: Tue, 28 Jul 92 06:16:36 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- Lines: 31
-
- Can anyone tell me how to get a device name, given a lock on the volume
- that the device is associated with. I'm writing a program that takes
- as input locks (to disks) from Workbench, and need to go to the appropriate
- device name ("DF0:", "WB_2.X:", etc).
-
- I tried doing something like this already:
-
- {
- for(all disk devices in system)
- {
- lock=Lock(devicename,ACCESS_READ);
- if(SameLock(lock,volumelock)==LOCK_SAME)
- unlock lock;
- return device name
- else
- unlock lock;
- }
-
- return error;
- }
-
- But this caused Workbench to become unstable (dragging an icon into a
- floppy disk's trashcan froze Workbench), even with all the appropriate
- checking of return values, etc. Could this be a bug in Workbench, or
- am I missing something (Kickstart V37.175, Workbench V37.67)?
-
- Thanks.
-
-
- --
- Dave Schreiber/davids@netcom.com (until 9/15/92)/"Ask, don't touch"
-