%OP%TNT %OP%BON %OP%PL64 %OP%DPF %OP%TM1 %OP%HM2 %OP%FM2 %OP%BM1 %OP%LM5 %OP%HE/%H2%Z88 Users' Club Software Library%H2%/ %OP%FO/Z186/@P@// %CO:A,12,70% %R%%H2%FileGroup%H2% by Tom Hawkins %R%Instructions %R%5th May 1992 These routines allow an operation to be carried out a on a set of files matching a given wildcard specification and updated after a given date and time. %H2%Description of program lines%H2% Line 30 defines an array %H2%dname$%H2% which is used to hold the directory structure while the list is being compiled. dname$ must have enough elements for the deepest directory tree, one element per directory level. Lines 40 to 130 demonstrate how the routines may be used. Line 40 asks for a wildcard file specification in %H2%fs$%H2%. Line 50 asks for a date, which should be in the format (eg) '12-Jun-1971 09:30:27'. Lines 80 and 90 perform a CLI routine to catalogue the files given by fs$ and record the list in :RAM.-/S.sgn. Line 100 calls the procedure %H2%PROCsel_files%H2% with two parameters giving the name of the file containing the catalogue list and the date from line 50. Line 110 erases the file in :RAM.-. Note that it is possible to perform the operation on a catalogue list in a file other than :RAM.-/S.sgn by altering line 100. The file catalogue is examined by PROCsel_files and PROCdo_file, using FNlead_spaces, FNfilename, FNdate, FNsize and FNlater. The names of those files which were last updated since the date and time given will be passed to %H2%PROCaction%H2% in the order in which they appear in the catalogue list. PROCaction may be altered to perform whatever action is required on the chosen files - adding to a list, printing, copying etc. In this example the filename is simply printed and its size added to the variable T%PC%. The code in PROCaction may refer to the following variables: %H2%Summary:%H2% To adapt these routines for your own use you should modify lines 40-130 and PROCaction to take the file specification and date from your own source and perform your desired operation on the files. Lines 30, 80, 90, 100 and 110 should be retained (or only modified if you know what you're doing!) For an example of how this routine has been used, see the Software Library program %H2%SXX%H2%, by Tom Hawkins and Phil Wheeler. %P0% %H2%Functions:%H2% The following functions may also be used, or lifted for your own use: FNlead_spaces FNtdate FNydate FNlater %H2%Other functions:%H2% FNfilename, FNdate and FNsize should not be accessed by user-supplied code as they change non-local variables and must be called in the correct order from PROCdo-file. %H2%Dates:%H2% All dates are in the format (eg) '12-Jun-1971' (without the quotes). All dates-and-times are in the format (eg) '12-Jun-1971 09:30:27' %H2%:RAM.-:%H2% It is not recommended to give a wildcard specification that includes :RAM.- as this may cause the Z88 to crash. %CO:B,12,66% f$ crd$ upd$ siz%PC% %CO:C,12,46% Full pathname of the file Date and time when file was created Date and time when file was last updated Size of file in bytes Returns its string argument stripped of leading spaces Returns today's date Returns yesterday's date Returns TRUE (-1) if the first date argument is later than the second, otherwise FALSE (0). If the first argument is the empty string, returns TRUE. %CO:D,12,42%%CO:E,12,30%%CO:F,18,18%