home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / newc_dev / dr_11.lzh / Dr.doc < prev   
Text File  |  1990-10-21  |  15KB  |  271 lines

  1.  
  2.                                     DR         (release 1.1)
  3.  
  4. What we got here is Yet Another CLI Directory Listing Command, called Dr
  5. (pronounced "dr") because it leaves out icons.  (Like, the missing I in Dir
  6. stands for icon...?  never mind.)  It is a => Fast And Full Featured <=
  7. program which is superior to all of the seven other Amiga directory listers
  8. I've tried.  I couldn't live without it.  Even its half-finished versions
  9. were preferable to Dir.  This is version 1.0.  The features it offers are:
  10.  
  11.   + By default, .info files are not mentioned in the output.  Instead, it
  12.     shows you which files have xxxxx.info files associated with them by
  13.     writing their names in orange.  This makes it much quicker and easier to
  14.     find the information you want, since more of the text on the screen is
  15.     actually relevant.  Any xxxxx.info file that is not associated with a
  16.     regular file or directory is shown normally, e.g. Disk.info.  You can see
  17.     all .info files normally with the -I option.
  18.  
  19.   + It is fully reentrant and reexecutable.  The "pure" bit is set.  Make it
  20.     resident, and AmigaShell has a classy built-in directory command.  (And I
  21.     didn't use any fancy new purifying startup code either.  I made it pure
  22.     the old fashioned way, by writing actual reentrant code in Aztec 3.6.)
  23.  
  24.   + It is about as fast as a directory listing program can possibly be on the
  25.     Amiga.  (Which is still slow.)  Other allegedly fast listing programs are
  26.     often slower (I have one that is sometimes slower than regular Dir), and
  27.     sometimes can't handle some devices, or have errors where others don't,
  28.     and some methods can sometimes fail to turn a floppy drive's motor off.
  29.     Benchmarks: the root directory of the SoundScape disk (v1.4) has 57 files
  30.     and directories.  Dir takes 16 seconds to scan it, eless takes 11,
  31.     fd takes 10, Dir with FSDirs takes 11, and Dr takes 6.5 seconds.  (All
  32.     times include writing output to a CON: window, with FastFonts.)  When I
  33.     created a floppy disk directory with 200 files in it, some of them
  34.     largeish in order to reduce efficient disk layout, Dir took exactly one
  35.     minute to scan it, eless took 34 seconds, fd fired up "read/write error"
  36.     requesters, and Dr took 16 seconds.  When using the Fast File System, Dir
  37.     is almost the same speed as Dr, but there's still a slight improvement.
  38.  
  39.   + Other commands may be available (I would think so, but I don't actually
  40.     have one) which will scan a single directory this fast, but I bet nothing
  41.     else does recursive listing of subdirectories as fast as Dr does with its
  42.     -R option.  Even with the Fast File System, the speedup is considerable. 
  43.     Benchmarks:  My hard disk's main partition, which uses the Fast File
  44.     System, took 120 seconds to list with Dir Opt A.  Dr -R took 75 seconds.
  45.     (The difference got smaller when I reformatted and restored the disk,
  46.     reducing fragmentation.  The times then became 116 vs 88 seconds; the
  47.     disk was much fuller in the second test.)  When I tried a floppy disk
  48.     with lots of fragmentation and a complex directory structure (my most
  49.     heavily used incremental backup disk) Dir Opt A took 71 seconds and Dr -R
  50.     took 30 seconds.  Another backup disk produced times of 23 vs 10 seconds.
  51.  
  52.   + It arranges the output in a variable number of columns, with spacing
  53.     based on both the length of the longest filenames and the width of the
  54.     window.  It assumes a width of 77 when output is going to some file or
  55.     device other than a CON: window.  By default, it sorts the entries in
  56.     columns, not in rows.  This makes it easier to find things alphabetic-
  57.     ally.  The -H option makes it sort in rows.
  58.  
  59.   + It handles AmigaDOS wildcard patterns, like #?.(c|o) to list all xxxxx.c
  60.     and xxxxx.o files.  And if an actual directory has a name with pattern
  61.     characters in it, like maybe a directory called "Doesn't-work?", it will
  62.     list that directory instead of expanding the pattern.  You can force it
  63.     to expand by adding an extra percent sign to the pattern, so it doesn't
  64.     match the name.
  65.  
  66.   + It can sort alphabetically (the default) or chronologically (newest
  67.     last) with the -C option.
  68.  
  69.   + It has an option (-O) to list each filename on a separate line as a
  70.     complete pathname.  This is useful for generating input to other
  71.     programs.  Especially when combined with -F (show only files) and -R
  72.     (show contents of subdirectories).  Someday I'll add something like the
  73.     LFORMAT option of List.  Files are listed in "natural" order (actually
  74.     reverse natural order) when you use this, instead of sorted.  This makes
  75.     the list more efficient for other programs to process, sometimes.
  76.  
  77.   + It can list the size of each file in bytes with the -S option, or list
  78.     complete information about each file and directory (size, protection,
  79.     datestamp, filenote) like the List program with the -L option.  -L is
  80.     automatic if the argument you give it is the name of a single file
  81.     instead of a directory.  The -X option makes it give this information
  82.     about a directory instead of showing that directory's contents.
  83.  
  84.   + The -U option makes it like "du", showing only disk space consumption.
  85.  
  86.   + It uses a significant amount of memory, but if that much isn't available,
  87.     it won't fail.  (Well not TOO often anyway...)  It will simply work less
  88.     efficiently.  When there's only a little extra room, it will work at the
  89.     same speed as Dir.
  90.  
  91.   + And last but certainly not least, it's public domain and the source
  92.     code is provided.  This includes the fast directory scanning routines
  93.     FastExamine and FastExNext, which many programs may find useful since
  94.     they are almost compatible with regular Examine and ExNext.  See the file
  95.     FastExNext.doc.  CREDIT:  the pattern matching code is PatMatch by Jeff
  96.     Lydiatt, available on Fish disk 85.
  97.  
  98. Directory names are listed before file names, and they are separated by a
  99. line of dashes, unless one or the other came up empty.  Each directory name
  100. is followed by a slash.  Only the name itself, not the slash, is orange if it
  101. has an icon.  Things with associated .info files will be marked as such even
  102. if the .info file itself is excluded by the pattern, or by the -D option.  If
  103. you list just a single file, it will check whether it has a .info file,
  104. unless you use the -I option.  It does not check to see whether files with
  105. names ending in .info are actual valid icon files.
  106.  
  107. Note that if the output is not a CON window, it doesn't show you which files
  108. had icons.  It used to precede iconed names with a plus sign, but I concluded
  109. that this was not a win.  If you want to find icons when you're saving the
  110. output, you just gotta use the -I option.  Let me know if you want this
  111. changed.  I heard that the numerous .info files are gonna disappear in
  112. AmigaDOS 2.0 anyway.  That and FFS in ROM will eliminate most of my reasons
  113. for writing Dr in the first place.  Sigh.  So the 2.0 version of Dr might
  114. be two thirds the size of this one, but not really better than some other
  115. programs.  Damn, a lot of the work I did in 1989 is turning out to be wasted.
  116. It would have been less wasted of course if I had gotten this thing out the
  117. door a year earlier ...  "Dr:  the Video Toaster of directory listers."
  118.  
  119. Pattern wildcard characters are currently only recognized at the end of
  120. a pathname (that is, after the last slash or colon if any); you can't yet go
  121. "Dr #?/src/#?.c" to find all .c files in subdirectories named src.  This
  122. ability will be added someday.  If anybody cares.
  123.  
  124. USAGE:  type Dr followed by zero or more file names, directory names,
  125. patterns, or options.  The options in this version are:
  126.  
  127.     ?   Briefly explain all of the options.
  128.  
  129.     -I  List .info files like normal files instead of marking the other
  130.         files they are associated with.
  131.  
  132.     -S  Show the size of each file in bytes.
  133.  
  134.     -C  Sort chronologically (newest last) instead of alphabetically.
  135.  
  136.     -H  Sort into rows instead of columns, if more than one column.
  137.  
  138.     -O  Put each filename on a separate line, as a complete pathname.  There
  139.         is no other extraneous output and no sorting.  Overrides -L, -S, and
  140.         -C.  The beginning of the pathname is the directory arg you
  141.         specified, not the absolute path.  (The pathname has a maximum length
  142.         of 300 characters.)
  143.  
  144.     -D  Do not show file names, only subdirectory names.  Cancels -F.
  145.  
  146.     -F  Do not show subdirectory names, only file names.  Cancels -D.
  147.  
  148.     -L  Show sizes, protection bits, datestamps and filenotes like List.
  149.         Overrides -S.  Show total bytes/blocks used.
  150.  
  151.     -X  Show directory args as if they were in a -L listing, instead of
  152.         scanning their contents.  Ignored if -R or a pattern is used.
  153.  
  154.     -R  Recursively show contents of all subdirectories.  If you're going to
  155.         descend a whole lot of levels (like more than about nine) you might
  156.     need a bigger stack than the default 4K.  * NEW FEATURE * -=> Dr
  157.     checks for adequate stack before entering each subdirectory.  An 8K
  158.     stack would let you go about 40 levels deep.
  159.  
  160.     -U  Show only disk space consumed without listing any names.  Overrides
  161.         -S, -L, -O, and -I.
  162.  
  163. Some other options and other features I might add someday:
  164.  
  165.     -A  Show file's timestamp as age; days and hh:mm:ss before present.
  166.         Or maybe -G means aGe and -A means show absolute date without any
  167.         stuff like "Yesterday" or "Wednesday".
  168.  
  169.     Some way to cause a pattern at the end of the path to apply to files in
  170.         all subdirectories scanned.  That is, path/foo#? would now be
  171.         essentially also equivalent to path/#?/foo#? and path/#?/#?/foo#?,
  172.         etc.  Maybe a pattern that starts with :: acts this way.
  173.  
  174.     Along that line ... a pattern starting with ~ would mean, all files and
  175.         directories that do NOT fit the pattern.
  176.  
  177.     Some way of inserting the filenames listed into a pre-specified line of
  178.     text, like List's LFORMAT option.  Also an option to execute the line
  179.     produced as a command instead of writing it out, thus creating a
  180.     "ForEach" command or the equivalent of the SPAT and DPAT scripts.
  181.  
  182. You can give several option letters after one dash, like "Dr -ch foo".  The
  183. case of the letters doesn't matter.  Each option affects those files and
  184. directories that come after it on the command line, except that any options
  185. at the end, after the last filename, act as if they were entered at the
  186. beginning.  Example:  "dr foo -s bar" lists directory foo without showing
  187. sizes, and directory bar with sizes shown.  If a directory name begins with a
  188. dash, put quotes around so that it isn't taken as options.  If you give an
  189. option twice, the second one cancels the first.  This means that if you make
  190. an alias like "alias list dr -lc []", you can make it sort alphabetically by
  191. saying "list -c".  Or, you can show directory foo with sizes, and directory
  192. bar without sizes, with the command "Dr -s foo -s bar".
  193.  
  194. When you combine -R with a pattern, the complete contents of those subdirect-
  195. ories whose names match the pattern will be shown.  If you combine -R with -D
  196. or -F, all subdirectories will be listed, with only the directory or file
  197. contents of each, according to the option, shown.
  198.  
  199. If you give more than one directory/pattern in the command line, each one's
  200. listing will be preceded by the name you gave, written like this:
  201.                               -- name --
  202. unless you use -O in which case the different listings will not be
  203. separated.  If you give no directory or pattern, it lists the current
  204. directory, of course.  Or you can specify the current directory as empty
  205. quotes: "".
  206.  
  207. Note that the usage totals given at the end of a -L or -U output count only
  208. the files and dirs actually listed.  If some of the files are marked as
  209. having icons, then the blocks used by those .info files are not counted (they
  210. are in the case of -U).  Likewise things excluded by a pattern or -D or -F. 
  211. But the total count of blocks used by all files and directories is given in
  212. parentheses.  If you want complete totals for everything, use the -I option
  213. (if you're using -L and not -U) and don't use -D or -F or a pattern.
  214.  
  215. There is another version of Dr which is called Dr-S here.  It is smaller and
  216. slower (and eats less ram as it runs) because it uses regular ExNext instead
  217. of FastExNext.  To make it, compile dr.c with SMALLSLOW defined, and don't
  218. link with fastex.o.  It is actually faster in some cases when AddBuffers
  219. is of some use, e.g. if you list the same dir twice on the slow file system. 
  220. It is about 5k bytes smaller than the regular Dr.  Some users might prefer
  221. it, especially those who don't use floppy disks much.
  222.  
  223. I did not give it a BCPL style argument template for reasons of size.  17k
  224. is plenty for a resident command.  (That's sure a lot bigger than Dir or
  225. List, but it's smaller than both together, and it pretty much replaces both. 
  226. It also replaces du (with the -u option) and Donald Kindred's rls (with
  227. options -orf).)  Maybe I should have used arp.library ... would use less
  228. memory *IF* you would routinely have that library loaded anyway.  I did make
  229. sure that quoted quotes are done with *" instead of Manx's default "", and
  230. that quotes make -options be treated as directory names.
  231.  
  232. The Amiga is now the fourth system I have written a directory lister for.
  233. First was TOPS-20 (one that showed only files that you are the owner of),
  234. next Kaypro II (fast, 2K long, sorted, showed size), third 4.2 BSD Un*#%$!x
  235. (like ls -ls but faster because don't look up group names, just indicate
  236. whether your group).  So this one is like the crowning achievement of a great
  237. career in directory lister writing.  There is now almost no use at all for
  238. any other directory lister, except maybe if you're using the LFORMAT option
  239. of List (I'll write something to do that kind of job sooner or later), or you
  240. actually find Dir's interactive mode to be of any use.  My original goal was
  241. just to produce an adequate alternative that left out .info files; my goal
  242. now is for Dr to be the best available.
  243.  
  244. Dr is in the public domain, written by
  245.  
  246.         bbses: try                      Paul Kienitz
  247.         Winners Circle 415-845-4812     6430 San Pablo ave.
  248.         Triple-A 415-222-9416           Oakland, CA  94608
  249.         slower: FAUG 415-595-2479       USA
  250.  
  251. Feature suggestions and bug reports are appreciated.  I think it's pretty
  252. bulletproof, but there might be some file devices it can't read properly,
  253. one never knows.  Shareware incentive:  anyone who sends in a financial
  254. contribution will receive...   (drum roll)   a nice thank-you note.  Which
  255. is more than I've gotten from some of our better known hackers.
  256.  
  257.  
  258. Differences between release 1.1 and release 1.0:
  259.  
  260. 1.0 gurued on many device drivers which did not support ETD_READ.  1.1 uses
  261. CMD_READ when ETD_READ fails, and the dumb mistake which caused a guru when
  262. it tried to report the error was fixed.
  263.  
  264. 1.1 pays attention to the MaxTransfer mount parameter, and if it is an
  265. integral fraction of the track size it pretends that this fraction is a
  266. "track", otherwise (gotta fix this someday) falls through to ExNext.
  267.  
  268. 1.0 did not check for adequate stack.
  269.  
  270. It also had a small bug in reporting .info files with the -o option.
  271.