DiskMAG Volume 1 Number 2 (Nov 1988) : UTILITIES / dl.doc

                                 DL
                      Program to list Amiga files
                        Written by Jim Garrison
                            Public Domain

  I have missed having a directory listing utility that works similar to
the UNIX ls utility.  So I finally got around to writing DL.  DL stands for
Directory Lister!  You can run DL from CLI only (No workbench).  DL uses
UNIX style wildcard characters '*' and '?'.  If you invoke DL without any
parameters, it will list your current directory in the short format.  In
the short format, DL will try to fit as many names on each line as it can
while maintaining neat columns.  In the short format, directory names
will be listed with a '/' appended to it so it's easier to identify.
In the long format, you get the filename, size in bytes, size in blocks,
and the file datestamp.  Files are normally sorted alphabetically, but
the long format allows them to be sorted by size and datestamp also.
DL can also search directories recursively (through all subdirectories).
You can stop DL at any time by doing a CNTL-C.  You can use I/O redirection
also.  DL assumes that the window being output to is 80 columns wide, when
I get a chance, I'll see if I can get it to find out the number of columns
in the window that the output is going to, so it can adjust it's formatting.

The best way to see what DL can do for you is to play with it.


SYNTAX:

 dl [-dlsrR?] filemask
 Where filemask can be a unix type '*' or '?' wildcard.
 Options are:
  d - Long listing sorted by date
  l - Long listing sorted by filename
  s - Long listing sorted by file size
  r - Reverse the sort
  R - Perform a recursive sort (ie. subdirs)
  ? - Print this message


Here's some examples of how to use DL:

1> cd ram:
1> dl
dl          dl.c        dl.lnk      listdir.c   listdir.h   temp        

6 files using 28281 bytes (59 blocks).


1> dl -s
temp1          0     1  09/27/1988 20:04:36
dl.lnk        64     1  09/27/1988 20:00:39
temp         113     1  09/27/1988 20:04:25
listdir.h    275     1  09/27/1988 16:36:45
listdir.c   4206     9  09/27/1988 16:49:37
dl.c       11144    22  09/27/1988 19:59:50
dl         12596    25  09/27/1988 20:00:47

7 files using 28398 bytes (60 blocks).


1> dl dh0:devs
devs/   
1 files using 0 bytes (0 blocks).


1> dl dh0:devs/
.fastdir               clipboard.device       clipboards/            
keymaps/               Mountlist              narrator.device        
parallel.device        printer.device         printers/              
serial.device          system-configuration   
11 files using 57310 bytes (120 blocks).


1> dl -sr dh0:devs/
narrator.device       23280    48  04/15/1988 22:21:19
printer.device        18676    39  04/15/1988 22:21:16
clipboard.device       6672    14  04/15/1988 22:21:12
serial.device          5304    11  04/15/1988 22:20:54
parallel.device        1904     4  04/15/1988 22:21:10
Mountlist               860     2  05/18/1988 21:18:05
.fastdir                382     1  05/14/1988 18:16:18
system-configuration    232     1  05/14/1988 18:16:08
keymaps                <DIR>    0  04/15/1988 22:21:07
printers               <DIR>    0  04/15/1988 22:21:44
clipboards             <DIR>    0  06/07/1988 16:22:51

1> dl -R dh0:devs/*i*
.fastdir               clipboard.device       clipboards/            
Mountlist              narrator.device        parallel.device        
printer.device         printers/              serial.device          
system-configuration   

dh0:devs/printers/
Alphacom_Alphapro_101   Brother_HR-15XL         CBM_MPS1000             
Diablo_630              Diablo_Advantage_D25    Diablo_C-150            
Epson                   Epson_JX-80             generic                 
HP_LaserJet             HP_LaserJet_PLUS        ImagewriterII           
Okidata_292             Okidata_92              Okimate_20              
Qume_LetterPro_20       

dh0:devs/clipboards/
0   
27 files using 132626 bytes (281 blocks).


1> dl -R dh0:devs/??i*
clipboard.device   clipboards/        printer.device     printers/          


dh0:devs/printers/
Alphacom_Alphapro_101   Brother_HR-15XL         CBM_MPS1000             
Diablo_630              Diablo_Advantage_D25    Diablo_C-150            
Epson                   Epson_JX-80             generic                 
HP_LaserJet             HP_LaserJet_PLUS        ImagewriterII           
Okidata_292             Okidata_92              Okimate_20              
Qume_LetterPro_20       

dh0:devs/clipboards/
0   
21 files using 100664 bytes (214 blocks).


BUGS:
I don't know of any major bugs in DL, but let me know of any you find.


If anyone has any enhancement ideas for DL, please let me know.

Hope you enjoy!

Jim Garrison
Daytime Phone: 408 746-5349