DIR

Updated June 2019; 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:

   A-Shell and therefore DIR recognize (a) traditional DevPPN names in the 6.3 format (six character name plus three character extension), (b) a format of 10.3 beginning in A-Shell version 897 of August 2004, and (c) a format of 72.8 beginning in A-Shell 6.5.1662 of June 2019. See the DIR switch LONG, the LIT command SET LONGDIR, and the system parameter OPTIONS=LONGDIR to control the horizontal length of your DIR display.

   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 DevPPN "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 DevPPN 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

2022 June, A-Shell 6.5.1717, DIR.LIT 3.4(172):  Updated to fix a very old bug which would result in the directory listing being duplicated if there were consecutive DEVICE statements for the same device—i.e. one normal DEVICE definition and one or more PPN-specific definitions

2019 June, A-Shell 6.5.1662, DIR.LIT 3.4(166):  Updated to accommodate a change in maximum filename.ext size, from 10.3 to 72.8. See the DIR switch LONG.

2018 November, A-Shell 6.5.1651, DIR.LIT 3.3(163): Updated to avoid a read-only error related to the smart-scrollback activation feature.

2017 July, A-Shell 6.5.1610, DIR.LIT 3.3(162):  Now makes the scroll bar visible if the environment supports it (A-Shell/Windows and ATE version 6.5.1610 or later) and the output of the command causes the screen to scroll.

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.