The "FilesExclude" Command |
The "Files" command can be told to ignore some files (see the "EXLIST" parameter). These have probably already had special handling or need to be ignored altogether.
An "exclusion list" contains a list of zero or more filenames which can be added to by this command. Exclusion lists can be cleared by the "FilesExcludeClear" command.
The "File" and "Files" commands automatically adds found files to any specified exclude list.
This command is rarely used as the "Files" command creates an exclude list if none exists (and so it is typically easier just to specify a different list if required).
The macro takes these parameters:
All other parameters apply to each mask specified and the masks are expanded by this call and all matching files will be added to the list. Filemasks are never stored!
The default for this parameter can be set via the DEFAULT_FILESEXCLUDE_NO_MATCHES_OK macro. The initial value is "N".
This parameter defines the name of a macro containing rexx code. The filter is passed the names of two rexx variables in the "FILE" and "EXCLUDE" parameters, if it does nothing then the file will be added to the exclusion list. To prevent a file being added to the list set "EXCLUDE" to "N" (see example below).
EXAMPLE - No Filter |
The following example adds all the files matching the 2 masks to the exclude list (note that both are in the same source directory, although the path is only specified once):
<$FilesExclude "selfreg_.mmh;Z*.mmh" EXLIST="XL_MMH"> <$Cabinet "COPYQ.DENNIS.SAVED.THEMES"> #define THEMESRC <$MY_WORKING_COPYQ_CONFIG>\themes <$FilesExclude "<$THEMESRC>\*.ico;desktop.ini" EXLIST="XL_THEME_FILES"> <$Files "<$THEMESRC>\*.*" EXLIST="XL_THEME_FILES" DestDir="DENNISTHEMEDIR"> <$/Cabinet>
EXAMPLE - With Rexx Filter |
This example has been kept fairly simple while still demonstrating the main points, specifying a mask "b*" and then removing these same files is of course "stupid"...
;--- Define the filter --- #DefineRexx 'StupidExcludeFilter' ;;Not realistic but still demonstrates how to do it! @@Name = translate(FilePart('n', {$File})); if left(@@Name, 1) = 'B' then {$Exclude} = 'N'; ;;Don't exclude any files whose names start with a 'B'... if right(@@Name, 4) = '.REX' then {$Exclude} = 'N'; ;;Don't exclude any ".rex" files... @@ParentDir = translate(FilePart('n', FilePart('s', {$File}))); if @@ParentDir = 'CSV' then {$Exclude} = 'N'; ;;Don't exclude files if the paranet dir is "CSV"... ;call say 'DEBUG FILTER: ' || {$Exclude} || ' : ' || @@ParentDir || '\' || @@Name #DefineRexx ;--- Use the filter --- <$FilesExclude EXLIST="Fred" "c:\tmp\a*;b*" FILTER="StupidExcludeFilter">