Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!sirius.ucs.adelaide.edu.au!adam.adelaide.edu.au!phil From: phil@adam.adelaide.edu.au (Phil Kernick) Newsgroups: comp.sys.amiga.tech Subject: Re: DateStamp HELP! Message-ID: Date: 20 Nov 90 23:53:52 GMT References: <1990Nov18.030410.7819@hoss.unl.edu> <364@amgraf.UUCP> Sender: news@ucs.adelaide.edu.au Organization: University of Adelaide Lines: 36 Nntp-Posting-Host: adam.adelaide.edu.au huver@amgraf.UUCP (Huver) writes: >If you need to do it from inside a program, Thad Floryan just posted to >comp.sys.amiga (as a follow-up to `compress' spawned question) an example, >in C source, by Jeff Lydiatt. >NOTICE, however, in Lydiatt's setDate() function he used: > arg[1] = (ULONG)IoErr(); /* lock on parent director set by DeviceProc() */ >which is incorrect. ParentDir() should be used for this purpose. I was the one who started the 'compress' discussion, and Lydiatt (and Thad) are correct and you are wrong. Consulting the RKM L&D and looking for DeviceProc() it says that a lock for the parent directory is returned by IoErr() - but remember that if you do any other dos calls inbetween, IoErr() will not return what you think. So the code stub has to go something like... mesg = DeviceProc(); stuff the parameters into the struct StandardPacket and using IoErr() to set arg[1], and then call PutMsg. I suspect that you did something else inbetween the DeviceProc and the PutMsg (like maybe a Lock) and this changed the return from IoErr and so you though that this would not work. It does. Phil. -- Phil Kernick EMail: phil@adam.adelaide.edu.au Departmental Engineer Phone: +618 228 5914 Dept. of Psychology Fax: +618 224 0464 University of Adelaide Mail: GPO Box 498 Adelaide SA 5001