Now I understand what the various messages I got about this meant - the file in the Trashcan should have the same 'update' date as the original file. I'd assumed most people would want the date at which the file entered the trashcan (i.e. delete the file if's been in Trash longer than x days.).
Drat. Now I will have to rewrite it slightly. Can the various respondents let me know how they'd like this done. If I understand correctly: 1. FUPDT on the file in Trash should return the file update date of the original file BEFORE it was Trashed. Easy enough using a routine like the one below (thanks Wolfgang, it helped explain things)? 2. The file backup date (offset 60 in the 64 byte file header) should then have the date at which the file entered Trash? These two dates are easily set using any of the file header setting extensions available, and just to please Norman Dunbar I'll use the DJToolkit ones seeing as there aren't many DJ programs that don't use this fantastic piece of software technology from ND! buffer=ALCHP(64) OPEN_IN#3,original_file$ error=READ_HEADER(#3,buffer) CLOSE#3 COPY_O original_file$ TO trashed_file$ POKE_L buffer+60,DATE OPEN#3,trashed_file$ error=SET_HEADER(#3,buffer) CLOSE#3 This sort of mechanism would allow a choice of whether to delete files older than x days or x days after they entered Trash! Basically, as long as what users want revolve around the info stored in the file header rather than for example adding a chunk of code to the end of each file in Trash with restoration info, I'm happy to try this - let me know! -- Dilwyn Jones ----- Original Message ----- From: Wolfgang Lenerz <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 23, 2002 7:25 AM Subject: Re: [ql-users] Q-Trans Trash can > > On 21 Jan 2003, at 21:44, James Hunkins wrote: > > > > > I actually date stamp backup copies of the desktop files in QDT, using > > 'C' system calls that tap into QDOS stuff. It is actually quite easy > > (once I looked it up and tried it that is). > > > From Basic, this could be done as follows: > > def proc backup(filename$,source$,destin$) > rem backup file from source to destination, always overwrite > rem destination > local c%,mydate1 > c%=fop_in(source$&filename$) > if c%<0: return : rem or use better error handling > mydate=fupdt(#c%) > close #c% > copy_o source$&filename$,destin$&filename$ > c%=fopen(destin$&filename$) > if c%<0: return : rem or use better error handling > set_fupdt #c%,mydate > close#c% > end def backup > : > > Wolfgang
