Article View: comp.sys.amiga.tech
Article #9305Re: Pathname Comparison
From: Peter da Silva
Date: Thu, 14 Jul 1988 11:01
Date: Thu, 14 Jul 1988 11:01
25 lines
1223 bytes
1223 bytes
Well, it looks like it should pretty much work, but this is smaller and might
be a bit more reliable, taken from the source to Browser:
----------
#include <exec/memory.h>
#include <libraries/dosextens.h>
SameFile(lock1, lock2) /* return true if the locks match */
long lock1, lock2;
{
struct FileLock *flock1, *flock2;
if(!lock1 || !lock2) /* handle special case of the zero lock */
return lock1 == lock2;
flock1 = (struct FileLock *) (lock1<<2); /* convert BPTRs */
flock2 = (struct FileLock *) (lock2<<2);
return flock1->fl_Volume == flock2->fl_Volume &&
flock1->fl_Key == flock2->fl_Key;
}
--
-- `-_-' Peter (have you hugged your wolf today?) da Silva.
-- U Mail to ...!uunet!sugar!peter, flames to alt.dev.null.
-- "Running OS/2 on a '386 is like pulling your camper with an Indy car"
Technical Details
Message-ID:
<2305@sugar.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!ucsd!ames!vsi1!altnet!uunet!sugar!peterReferences:
<483@amanpt1.zone1.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!ucsd!ames!vsi1!altnet!uunet!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.sys.amiga.tech Subject: Re: Pathname Comparison Keywords: function, C, help Message-ID: <2305@sugar.UUCP> Date: 14 Jul 88 11:01:00 GMT References: <483@amanpt1.zone1.com> Organization: Sugar Land UNIX - Houston, TX Lines: 25