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