Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!newstop!sun!amdcad!dgcad!dg-rtp!wgate!lanzo From: lanzo@wgate.UUCP (Mark Lanzo) Newsgroups: comp.sys.amiga.programmer Subject: Re: dos.library ACTION_SET_DATE question. Message-ID: <182@atesysv.UUCP> Date: 8 Apr 91 19:28:00 GMT References: Reply-To: lanzo@atesysv.UUCP (Mark Lanzo) Organization: Wandel & Goltermann Technologies, Inc. Lines: 55 In a prior article ben@epmooch.UUCP (Rev. Ben A. Mesander) wrote: > I grabbed an excellent program called PickPacket from a fish disk. It's > a great tool to play with dos.library packets. Another fine product brought to you by those folks at the Software Distillery :-) > I'm trying to set the date on a file with it. The first thing I do is > send an ACTION_LOCATE_OBJECT packet to df1:. I'm trying to set the date > on a file named "df1:ruru". The ACTION_LOCATE_OBJECT packet is filled out > with Arg1: NULL, Arg2: (BSTR) ruru, Arg3: EXCLUSIVE_LOCK. > It appears that I get a lock on the file "ruru". So now, I > send an ACTION_SET_DATE packet with Arg1 being the lock I obtained from > the ACTION_LOCATE_OBJECT packet, and Arg2 being a pointer to a buffer > containing nulls (I want to set the date to "the beginning of time"). > But I get an error back: "Invalid object lock". This happens whether I > give a shared or exclusive lock to the ACTION_SET_DATE packet. Unfortunately, I can't remember what the exact args for ACTION_SET_DATE are; but I'll take a few stabs in the dark: 1. Pickpacket is incorrectly passing the pointer to the DateStamp structure (BPTR vs APTR). 2. Pickpacket is prompting for the wrong args, and you need: Arg1 = Lock on parent, Arg2 = name of file, Arg3 = Ptr to DateStamp. Note that Arg1 can NOT be null. Also, try this: 3a. Get a lock on DF1: LOCATE_OBJECT: Arg1=NULL, Arg2=NULL, Arg3=Shared (assume pickpacket returns "FileLock 1"). 3b. Get a lock on DF1:ruru LOCATE_OBJECT: Arg1="FileLock 1", Arg2="ruru", Arg3=Shared (assume pickpacket returns "FileLock 2"). 3c. Now do the SET_DATE, using "FileLock 2". If this is due to a bug in pickpacket 1.0, then the solution is to wait until I finish with pickpacket 2.0! Yes, there really is a Pickpacket 2.0 in the works. It incorporates the DOS 2.0 packets, and the 2.0 "3D" look (It is still 1.3 compatible though). I'll double-check to see what the correct way to use SET_DATE is. It definitely does work now in Pickpacket 2.0 -- I spent rather too much time implementing that particular packet! [With the new version you allocate a DateStamp structure and give whatever date you want]. More to come, ... Mark