home *** CD-ROM | disk | FTP | other *** search
- .KEY pathname,width,dirtag
- .DEF pathname ""
- .DEF width 77
- .DEF dirtag /
- .BRA {
- .KET }
- ; AmigaDOS script "ld" by Kent Paul Dolan
- ;
- ; Accepts a single parameter, the pathname of the directory to be listed.
- ; Produces a sorted directory with as many columns as will fit in a full
- ; width (77 character wide) Amiga bordered window, such as the one for
- ; the AmigaShell or, here, the "less" file display utility, and displays
- ; it using the PD "less" utility. All work files are in "T:" and are
- ; deleted at the end of the script. The "column_set" program is a small
- ; PD Modula-2 utility written by the author of this script.
- ;
- ; Create a single column listing of the files in <pathname>
- ;
- list > t:ld.1 {pathname} files lformat="%S"
- ;
- ; Add the directories to the listing, but flag them with a tag string to
- ; distinguish them from the files.
- ;
- list >> t:ld.1 {pathname} dirs lformat="%S{dirtag}"
- ;
- ; Sort the lot together.
- ;
- sort from t:ld.1 to t:ld.2
- ;
- ; Use my PD Modula-2 utility to rearrange the names into as many columns
- ; as will fit in a full sized window; "column_set" does one pass to
- ; size the file names looking for the longest name, and a second pass
- ; to create the output from the input. Input is a file with one file or
- ; directory name per line, output is the same set of names set in columns.
- ;
- column_set -w {width} t:ld.2 t:ld.3
- ;
- ; Use the PD "less" utility to put up a window in which the directory
- ; names may be scrolled up and down; if you don't have "less", replace
- ; it here with "more", the standard AmigaDOS text file display routine.
- ;
- less t:ld.3
- ;
- ; Clean up the work files.
- ;
- delete t:ld.1 t:ld.2 t:ld.3
-