Updated January 2016; see History
DIR {listspec=} {fspec1{,...fspecN}} {switches}
The DIR command implements most of the switches available under AMOS, plus some additional switches that are unique to A-Shell. See the following topic DIR Switches.
Aside from the slightly different set of switches between AMOS and A-Shell, note the following differences in behavior:
• Keep in mind that files will only be listed if you have file read permission for them. In the case of UNIX, it is also required that the directory, and all directories above it, have the execute bit set. (The execute privilege on a directory controls whether the directory can be traversed.) This applies equally to all wildcard commands, such as COPY and ERASE, which will effectively not see files for which you have no read permission.
• Unlike under AMOS, where you could use DIRSEQ to sort the files in a directory, it is rather non-standard to sort an actual directory under Windows and UNIX. Instead, the DIR program itself is usually relied on to sort the display rather than sorting the directory itself. Consequently a set of sorting options has been added to the A-Shell version of DIR; see switches beginning with "S" in table of DIR switches.
• Since DIR
works by actually scanning the directory structures, it will find files that do
not fit the AMOS "six dot three" format, or even A-Shell's extended "ten dot
three" format, and thus cannot be located by non-wildcard commands or by BASIC
file open statements. DIR will truncate files with
names longer than "six dot three" but will use some kind of flag character, such
as ">" to give you a clue that there may be more there than meets the
eye.
One particularly nasty problem of this type occurs only under UNIX,
which has case-sensitive filenames. Since normal files are by convention named
in lower case, A-Shell translates AMOS filespecs (which are not case sensitive)
to lower case. But some file transfer programs may produce upper case filenames
when transferring files from AMOS to UNIX. Such files will appear in a DIR
listing (which folds the displayed filenames to upper case to match the way AMOS
DIR listings appear). But they will appear to be invisible to non-wildcard
commands and BASIC file option operations. To avoid this problem, make sure your
file transfer program has an option to force lower case and that the option is
activated. To fix the problem, see the trlcs utility which is shipped with
A-Shell in the bin directory.
• Blocks sizes for sequential files will differ between AMOS and A-Shell, due to differences in underlying block formats. AMOS uses 512 byte blocks with 2 or 4 byte links to connect the blocks in a sequential file, depending on the device format, and thus each full block contains 508 or 510 bytes of data. None of the other OS platforms that A-Shell runs on requires such links (they are implemented in the directory rather than in the disk blocks), so A-Shell treats each "block" as capable of holding up to 512 bytes of data. (Physical blocks are likely to be much larger these days, and in fact, the very idea of a "block" may be questionable - most platforms use a stream-of-bytes model instead - but 512 byte logical chunks are still widely recognized as a kind of traditional unit of size.) To compare files between AMOS and A-Shell, it is best to use SIZE.LIT to get the logical size, and/or DIR/H to check for an exact data match.
See Also
• PAGE as an alternative to Ctrl+S and Ctrl+Q for limiting the scrolling speed of the display.
History
2016 January, A-Shell 6.2.1425: Add switches /MAXSECS and /MINSECS.
2013 June, A-Shell 6.1.1354: Add /1 switch.
2011 June, A-Shell 5.1.1221: Remove the limit on the number of PPNs allowed per device.