home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11712 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.2 KB  |  41 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!darwin.sura.net!mips!mips!decwrl!csus.edu!netcomsv!mork!davids
  3. From: davids@netcom.com (Dave Schreiber)
  4. Subject: Going from volume lock to device name
  5. Message-ID: <rfmmkdp.davids@netcom.com>
  6. Date: Tue, 28 Jul 92 06:16:36 GMT
  7. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  8. Lines: 31
  9.  
  10. Can anyone tell me how to get a device name, given a lock on the volume
  11. that the device is associated with.  I'm writing a program that takes
  12. as input locks (to disks) from Workbench, and need to go to the appropriate
  13. device name ("DF0:", "WB_2.X:", etc). 
  14.  
  15. I tried doing something like this already:
  16.  
  17. {
  18. for(all disk devices in system)
  19. {
  20.    lock=Lock(devicename,ACCESS_READ);
  21.    if(SameLock(lock,volumelock)==LOCK_SAME)
  22.       unlock lock;
  23.       return device name
  24.    else
  25.       unlock lock;
  26. }
  27.  
  28. return error;
  29. }
  30.  
  31. But this caused Workbench to become unstable (dragging an icon into a 
  32. floppy disk's trashcan froze Workbench), even with all the appropriate
  33. checking of return values, etc.  Could this be a bug in Workbench, or
  34. am I missing something (Kickstart V37.175, Workbench V37.67)?
  35.  
  36. Thanks.
  37.  
  38.  
  39. -- 
  40. Dave Schreiber/davids@netcom.com (until 9/15/92)/"Ask, don't touch"
  41.