home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12558 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  2.5 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!mips!darwin.sura.net!jvnc.net!netnews.upenn.edu!dsinc!bagate!cbmvax!jesup
  2. From: jesup@cbmvax.commodore.com (Randell Jesup)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: questions on locks
  5. Message-ID: <34566@cbmvax.commodore.com>
  6. Date: 21 Aug 92 23:26:04 GMT
  7. References: <1992Aug3.215626.7524@jato.jpl.nasa.gov> <1992Aug4.115729.20036@rz.uni-karlsruhe.de>
  8. Reply-To: jesup@cbmvax.commodore.com (Randell Jesup)
  9. Distribution: comp.sys.amiga.programmer, comp.sys.amiga.applications
  10. Organization: Commodore, West Chester, PA
  11. Lines: 46
  12.  
  13. ry41@rz.uni-karlsruhe.de (Bernhard Moellemann) writes:
  14. >>    assign yzx: xyz:string
  15.  
  16. >>Later, if some application program tries to open a file off of the
  17. >>assigned directory, I receive an open request that begins with the assign-
  18. >>ment name followed by the name of the file to open.
  19. >>    yzx:abc
  20. >>...I of course don't know what yzx: refers to and find its DOS list
  21. >>entry.
  22. >
  23. >Thats wrong. You have to ignore all up the first colon (if there is one).
  24. >You must identify your 'files' by the returned lock and the name without
  25. >the part in front of the colon. I do this via fl_Key. You get this lock
  26. >in one of the dp_ArgX-fields. 
  27.  
  28.     Correct.  Assigns are handled by dos putting an appropriate lock
  29. in (usually) dp_Arg1.  The handler must ignore anything up to AND INCLUDING
  30. the ':'.
  31.  
  32. >You should really create a little 'house-keeping" structure which binds
  33. >names to locks. A pointer to this could be placed in fl_Key. 
  34.  
  35.     Actually, unless you support the ACTION_SAME_LOCK packet (and maybe
  36. even if you do), you should try to place a unique value for each object in
  37. the key field.  A filesystem should never care what name was perviously used
  38. to get a Lock.
  39.  
  40. >>The locks returned are quite generic. The volume fields all share
  41. >>the same device node entry. Also, the fl_Key fields are set to zero. Out of
  42. >>curioisty, does AmigaDOS assume all the locks are the same, because all the
  43. >>fl_Key fields are?
  44. >
  45. >Perhaps it does. Better do something useful with fl_Key. There are several 
  46. >programs which assume equality if the fl_Key entries are the same. The fl_Key
  47. >field is yours - use it!
  48.  
  49.     AmigaDos won't assume they're the same IF you support ACTION_SAME_LOCK,
  50. but some 3rd-party programs will.
  51.  
  52. -- 
  53. "Rev on the redline, you're on your own; seems like a lifetime, but soon it's
  54.  gone..."  Foreigner
  55. -
  56. Randell Jesup, Jack-of-quite-a-few-trades, Commodore Engineering.
  57. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com  BIX: rjesup  
  58. Disclaimer: Nothing I say is anything other than my personal opinion.
  59.