Ranges General Rules Size Ranges Date Ranges Time Ranges Exclusion Ranges Description Ranges
|Scroll Prev Top Next More|
Most internal commands which accept wild cards also allow size, date, time, exclusion, description, and owner ranges to further define the files that you wish to work with. TCC will examine each file's properties to determine whether or not the file meets the range criteria that you have specified.
A size, date, time, or exclusion range specification begins with the switch character /, followed by a left square bracket [ and a character that specifies the range type: s for size range, d for date range, t for time range, or ! for exclusion range. The s, d, or t is followed by a start value, and an optional comma and end value. The range ends with a right square bracket ]. For example, to select files between 100 and 200 bytes long you could use the range /[s100,200].
A description range begins with /I. See Description Ranges for the full syntax.
If you use the syntax /[=], TCC will display a dialog that allows you to select the ranges you want. For example:
copy /[=] file1 file2
The Date, Time, Size, Owner, and Description ranges support the ! (NOT) operator to reverse the test.
You can reverse the range test by preceding the range argument with the ! character. For example, to select files that are less than 100 bytes or more than 1000 bytes:
If you combine different types of ranges, a file must satisfy all range specifications to be included. For example,
means files last modified between February 8, 2018 and February 9, 2019, which are also between 1,024 and 2,048 bytes long.
You may not repeat the same range type in a command.
When you use range specifications in a command, they should immediately follow the command name, so that any additional switches for the command are after any range(s) used. If the range is placed later in the command it may be ignored, or cause an error. Unlike some command switches which apply to only part of the command line, the range usually applies to all file names specified for the command. Any exceptions are noted in the descriptions of individual commands.
For example, to get a directory of all the *.C files dated October 1, 2018, you could use this command:
dir /[d2018-10-1,+0] *.c
To delete all of the 0-byte files on your disk, you could use this command:
del /[s0,0] * /s
And to copy all of the non-zero byte files that you changed yesterday or today to your floppy disk, you can use this command:
copy /[d-1] /[s1] * a:
It can be tedious to type all of the elements of a range, especially when it involves multiple dates and times. In this case you may find it easier to use aliases for common operations. For example, if you often wish to select from .DAT files modified over the last three days and copy the selected files to another drive, you might define an alias like this:
alias workback=`select /[d-2] copy (*.dat) e:\datfiles\`
For more complex requirements, you may want to use internal variables (e.g. _DATE or _TIME) and built-in variable functions (e.g. @DATE, @TIME, @MAKEDATE, @MAKETIME, @FILEDATE, @FILETIME, or @EVAL). These variables and functions allow you to perform arithmetic and date / time calculations. You may also define your own variable functions, to perform more complex manipulations repetitively.
See the individual types for details on specifying ranges:
Ranges cannot be used with filename completion or in filename parameters for variable functions, except as described under the individual functions.
Do not use ranges with @file lists. See @file lists for details.
All ranges are inclusive. For example, a size range which selects files from 10,000 to 20,000 bytes long will match files that are exactly 10,000 bytes or 20,000 bytes long, as well as all sizes in between; a date range that selects files last modified between 2018-10-27 and 2010-18-30 will include files modified on each of those dates, and on the two days in between.
If you reverse range start and end values TCC will recognize the reversal, and will use the second (lower) value as the start point of the range and the first (higher) value as its end point. For example, to select files between 100 and 200 bytes long could also be entered as /[s200,100].