 
                            NewList 4.9
                                by
 
                            Phil Dietz
                       10542 Cuming Street
                         Omaha, Nebraska
                              68114
 
                            16-Mar-91
 
      This is TuitionWare.  Send a buck to help me get through college.
    (It's only a buck.  It's not like 35.00 that some dingos ask for.
    If ya can't afford a buck, send a floppy.  Their equal currency
    to me.   :-)   One buck for unlimited updates.  One buck for a
    REAL list program.  One buck and all of your enhancements will
    come true.  SUBLIMINAL HINT:    B     U     C     K
 
What is Newlist?
 
       AmigaDOS is great.  It not only allows you to manipulate files
    graphically VIA workbench, but it also allows you to manipulate
    files on a command line basis.  Commodore utilized the command
    line interface by offering powerful commands to help the user
    do what he wants to do.  One of the handiest is LIST.  It not only
    gives a directory listing of names, but also offers filesizes, file
    protection, and file creation.
   
       But LIST isn't perfect.  It doesn't offer much sorting.  It doesn't
    offer much date manipulation.  It doesn't allow name filters, so
    immense directories HAVE TO BE shown.  TRUE, LIST is small, but
    sometimes POWER comes first.
 
What does that mean?
 
       NewList offers the SPEED of list, and the POWER of a database.
    Now directories can be sorted not only by name, but also by size or
    date.  Now directories can be sorted through an alphabet filter
    so only certain files will be shown (like D through G).  A quick
    option has been added to utilize the screen space, so no more
    2 column output by MR. dir. :-)  Are you tired of the date format?
    Now you can create your own!
 
Ain't it like LS?
 
       Well sorta.  LS and LS-jr are very good LIST replaements.  They
    are quick and offer UNIX compatibility.  That's about it
    though.  Newlist is JAM PACKED with options.  With NewList, the
    user is given processing power.  You can sort a directory the way
    YOU want it.  
 
 
       NewList was designed around speed- algorithim,
    structure selection, and all.  Every type of area was analyzed;using
    trees, lists, hash tables, AmigaDOS structures, the whole tomato.
    Only the fastest and smallest 'c' structures were allowed.
    The only restriction was the 'c' Compiler itsself.  Lattice 5.10
    should come closer to the GOD-LIKE ASSEMBLER level....
 
Features of NewList:
 
   1)  It's PURE!  NewList is REALLY quick if it's resident.
   2)  Very fast algorithms.
   3)  Completely dynamic.
   4)  Tons of sorts and filters (including the needed BY DATE!)
   5)  Full UNIX WILDCARD (n*l*s? = newlist) and character filtering.
   6)  A slick date construction kit with 5 premades.
   7)  ANSI.
   8)  a slick multi-columnar quick option to utilize screen space.
   9)  ENV: support!
  10)  Tons and Tons O' Flags and Switches!
 
 
Usage:  NewList ?
 
NewList  4.9  by  Phil Dietz  NCEMRSoft
 
NewList [FLAGS ie. -q -v] <path and wild>
 
       o  Overlook ENV:NEWLIST          a  Dont use Today, Yesterday, etc.
       b  Display Blocks                k  Display Disk Keys
  d01234  Five Date/Time Formats.      df  "string"  Custom Date.  See docs
       r  Displays list in REVERSE      n  Displays COMMENTS
       s  Sort by Name                 ss  Sort by file Size
      sd  Sorts by Date                sc  Sort by Comment
       h  No header                     i  Ignore .info files!
      gd  Show ONLY dirs               gf  Show ONLY files.
      gb  Show BOTH dirs/files grouped  u  Show DEVICE: usage info
      fA  Files start with A           tZ  Files go to Z
       c  CASE sensative with -f -t     z  LS style directories
       q  Quick option!                qs  Quick Option with FileSizes!
       v  Vertical sort quick columns
     y #  Use # columns for quick     l #  Show files made in last # days
 
NOTE:  each flag must have a - identifier.  ie  -q -sd -i -z -l 20
 
 
FLAGS IN DEPTH:
 
   [-o]   When you want to OVERLOOK the ENV:NEWLIST variable.  Using
          [-o] instead of another overriding flag yields the normal
          print-as-being-read format.
 
   [-a]   Forgets about the TODAY, YESTERDAY, bologna.
 
[-b] [-k] Instead of the default display of filesize, newlist will
          instead display BLOCKS or DISKKEYS respectively.
 
[-d01234] Five different pre-made date formats ranging from the
          fully expanded 1st grade letterhead (Friday, November 9, 1990,
          05:30:24 PM) to the default LIST format to slashes, dots,
          and dashes to DateStamp values.
 
  [-df]   Allows you to create your own Date format.  The format is
          -df "DATE STRING".  Mark RinFret offers an easy to use Date
          maker, so I added it.  Here are the flags available:
 
            y => year minus 1900
            Y => full year value
            m => month value as integer
            M => month name
            d => day of month (1..31)
            D => day name ("Monday".."Sunday")
            h => hour in twenty-four hour notation
            H => hour in twelve hour notation
            i => 12 hour indicator for H notation (AM or PM)
            I => same as i
            n => minutes    (sorry...conflict with m = months)
            N => same as n
            s => seconds
            S => same as s
            t => prints TODAY, YESTERDAY, or Day of the week if applicable.
                 If the file doesn't fall in the last week, it will be
                 blank.
 
                Simply make a C string like printf.
             -df "Date: %02d-%M-%02y at %02h:02n:02s" 
 
                              yields
                    Date: 11-Jan-90 at 01:03:20
 
    It's Easy.  If you are daring you can even include ANSI codes for spice.
 
  [-r]    Displays a list in REVERSE from top to bottom.  WHY?  Simple.
          Instead of waiting for the whole list to scroll by to see a
          file at the bottom, you can reverse the list and crtl-c to
          stop quick!  It's also handy when sorting by date.  All of
          the newest files will be displayed first.
 
  [-sn]   Sorts files alphabetically.  A synonym is just [-s].
 
  [-ss]   Sorts files by file size.
 
  [-sd]   Sorts files by date of creation.  Very handy!!
 
  [-sc]   Sorts by Comments.  If you use FileNotes wisely, you can
          have your directories be grouped by file type.  Simply
          add a filenote to each file and give it a type (Picture, GIF,
          Utility, NoiseTracker, etc.)  Now when you view by [-sc],
          the files will be together!
 
[-gd|-gf] Groups the display so ONLY dirs or ONLY files are shown
          respectively.  This is an option of LIST I had to add.
 
  [-gb]   Shows BOTH directories and files.  Output is similar to DIR.
 
   [-u]   Shows bytes FREE and bytes USED on disk.  Now you can get
          all your needed info with one command, instead of a "dir
          list info" combo.  Note: due to RAM:'s variable size,
          the bytes free will be zero.
 
   [-n]   Do you hate seeing those huge FILENOTES destroying your
          directory list?  This flag will toggle if you want to see them.
          If not present, a simple "Comment" will be shown to tell you
          "hey mister, you can read me if you wanna."
 
   [-h]   Doesn't display the header file.....ohhhhh.....big deal!
          Well it does seem off place in the -q quick directory, so
          it might help.  Another LIST option (holy cow!)
 
   [-c]   When using the letter filters, this flag will also take into
          affect the CASE of the filter letter.  So now only upper or
          only lower case files can be displayed.
 
          NOTE: [-fA] or [-tZ] must be set to an alphabetic character
                to utilize case sensativity!  The default letters are
                SPACE and, so [-c] will not work unless you change them!
 
  [-fA]   The MINIMUM letter for the filter.  Let's say you only want to
          view files greater than or equal t.  Simply set -ft.  Very
          handy for printing lists where you left off the night before.
          Remember -f as  FROM A
 
  [-tZ]   The MAXIMUM letter for the filter.  Only files less than or equal
          to the letter will be shown.  To see files h through l 
          simply set   -fh -tl.
          Remember -t as TO Z
 
   [-i]   Ignore .info files!
 
 [-l #]   Show files last made since # days ago.
          Now you can view files that were made in the last two weeks
          without viewing a whole directory. (ie newlist -l 14)
 
 [-y #]   Force # columns to [-q] quick option.  Use this option when
          re-directigthe output to a WIDE printer.  ie. to utilize a
          printer with 20 pitch type, use  newlist >prt: -q -y 9 dh0:
 
   [-q]   Gives a QUICK and easy listing of the directory.  The entire
          screen will be utilized and multi-columns will be created.
          Because of its simplicity, not all of the flags are usuable.
          Names will be white, and directories will be another color.
          NOTE: some flags won't work properly with [-q].  I'm still
                adding -gb -gd -gf -f -t and -c...
 
  [-qs]   Quick option WITH file-sizes!  A very very handy option very
          similar to DIR, but with multi-columns.  Note: if you'd rather
          see blocks or keys instead, simply use -b or -k with it.....
 
 <path>   the directory to view.  Wildcards are supported.  (Yes, UNIX style
          and yes, complex.   ie.  *ew?is*  = newlist)
 
 
    All of the flags and path can be used in any order.  
      newlist dh0:*.c -s -r  =  newlist -s dh0:*.c -r 
 
    All of the flags can be used together (-q has exceptions):
      You can view a directory through a case sensative character filter,
      of files made in the last 2 weeks, sorted by date in reverse order,
      showing block size , with a custom dateformat string,
      hiding .info files, and using a UNIX wildcard.
 
Environment Variable support:
 
      ENV: variables are NOW supported (just like I said I would).  Now
   long customized argument lists can be spared!  The variable
   ENV:NEWLIST contains any flags you want to have automagically set upon
   initiating newlist4.  To utilize the env: support, use ED
   or CED and create ENV:NEWLIST by typing in the flags you want
   to have default (ie. -r -sd).
 
      With ENV: comes a diminished return.  Now if you want the standard
   list type display (files out of order and displayed as they are read)
   , then the new -o option must be used.  An alternative is to simply 
   delete ENV:NEWLIST.
  
   NOTE: to override the ENV:NEWLIST, you can enter [-o] or you can type
         any different flag.  Suppose  ENV:NEWLIST is "-r -sd -d3",
         to sort by size simply  newlist4 -ss or newlist4 -o -ss
 
How to Create ENV: variables:
 
      Make sure ENV: is assigned to a directory.  Now use the Commodore
   supplied command setenv.  Here is an example of its use:
 
           setenv  newlist  "-q -sd -r -i"
 
 
BUGS with AmigaDOS supplied LIST?
 
       Yes, there are some bugs with list.  One of THE biggest is that you
    cannot name your directories PAT, KEYS, DATES, NODATES, SUB,
    SINCE, SORT, TO, UPTO, QUICK, BLOCK, NOHEAD, FILES, DIRS, or
    LFORMAT.  The parser interprets them as flags and not your dir!
    Technically you CAN name the directory to these statements,
    but the only way to view the directory correctly is to CD to it
    first!!  I wonder why they didn't incorporate a simple -b flag instead
    of the cumbersome BLOCK??  
 
BUG with LS?
 
       Besides the sloppy code, some of the UNIX ported material was not
    thought-out in porting to the amiga.  The ONE thing LS forgot about
    was the one floppy user!  The ONLY way to survive a dir was to type
    dir myflopname:.  A system requester would say insert myflopname: then
    you'd insert the disk and click ok.  Well, ls's error trapping
    removes the requesters so the one drive user is doomed!
    Oh well.  Not to many of them left. Not me....! :-)
 
 
~~~~~~~~~~~~~~~~
 
Comments:  First off.  Rename newlist to nl (for newlist), stick it in
           your c: directory, and PURE it.  People use names that are short
           and you know that you want to type nl instead of newlist.
           Then edit your Startup-Sequence to make nl RESIDENT upon bootup.
           (add  RESIDENT c:nl or ARES c:nl, depending if you use ARP)
 
           Enjoy.  PLEASE send a buck.  I need it.  I'll be your friend...
           If you'd like to join the National Organization NCEMRS
           or NCEMRSoft please contact me.  NCEMRSoft is a group of 
           programmers for the Amiga and Mac that share ideas, algorithms,
           beers, etc.  We ain't no lamer computer club.  It just gives
           you a title and a source for help and code optimization.
           Members range come from U of Neb-Lincoln, U of Neb-Omaha, 
           U of Texas, MSstate, Iowa State, and others!
 
           Keep in mind:  this is a very useful tool.  A tool that only
                          costs $1.00.  It's a blue light special :-)
 
           For quick response mail until May 10, 1991 to:
  
               Phil Dietz -- NCEMRSoft               or email to
               442 Abel North                  231b3678@fergvax.unl.edu
               880 n 17th Street               235b5271@fergvax.unl.edu
               Lincoln, NE  68508
 
~~~~~~~~~~~~~~~~~~~~

Here are the timings I've clocked to help you decide which lister to use.


  Sorting a huge HD FFS directory with 247 filenames (12-20 chars each)
    timed with a Swiss Made Tradition Stop Watch and timed 3
    attempts for each and then averaged.
 
                   to sort      to complete display      size
                   -------      -------------------      ----
WB13 list          NO SORT AVAILABLE!                    9972
     DR1.2 -L      8.3 secs           20.0 secs         17104
     newlist40     5.7 secs           18.7 secs         13484
ARP  list          7.3 secs           18.5 secs          2500
     newlist49     5.7 secs           17.9 secs         15120
     newlist49-ls  5.7 secs           17.4 secs         15120
     ls-4.11jr     6.3 secs           15.5 secs         11504

-

WB13 dir          14.4 secs           20.5 secs          8772
     DR1.2         8.3 secs           12.5 secs         17104
ARP  dir           6.9 secs           12.0 secs          2200
     ls-4.11jr     7.1 secs           10.9 secs         11504
     newlist40 -q  5.7 secs           10.0 secs         13484
     newlist49     5.7 secs            9.3 secs         15120


  Newlist has more options!
   - Date ** Construction **
   - a more compact Quick display
   - ENV: support
   - Character Filters  (ie only dirs g-l  lowercase only)
   - Group Displays
   - UNIX complex wildcards
   - Very fast sort routines
   - Sort also by size (bytes, blocks, or keys)
   - Flags, Flags, and more flags!
   - Support for CUSTOMIZED versions.


  Now that we know what the best lister is, let's send a Tuitionware Buck!

  ps. Sorry Paul Kienitz

~~~~~~~~~~~~~~~~~~~~

ver 4.9
   -Bug in stcgfp().  Had to manually catch when /* wildcard is
      used.  (yepp...forgot to add what I fixed in 4.5)
   -Bug fix in [-q] when no files were found.  (Thanx DAC)
   -Bug fix with usage help screen -ss != -sd  (Thanx Hari and DAC)

   -Added ANSI to header and footer.
   -Added [-u] disk usage.  Now displays bytes used and bytes free on disk.
   -Added [-gf] [-gd] [-gb] to quick option!  This may sound simple, but
      it took a bunch of tricks to get it to work.  Note:  due to
      vertical sort's nature, [-v] does not work with [-gb].  It does
      however work with [-gf] and [-gd].
   -Added [-sc] sort by comment!  Reasons...FileNotes are very handy.
      They let you describe or categorize your files.  One popular way
      is to categorize your files by type (like Utility, NoiseTracker,
      Picture, Text, etc.)  With [-sc], now these categorized directories
      will be grouped together.  Thus all utilities will be together as well
      as Pictures with Pictures, etc.
   -Boy newlist sure is getting big!  It's big and fast.....sorta like
       Ben Johnson.  I had better stop adding so many new options!

ver 4.8
   -Lost source to newlist.  Had to rewrite from 3.0 to 4.8.
     Cut 250 bytes though!
   -Fixed Custom DateString bug when used with TODAY feature etc.
   -Added [-qs] Quick Option with FileSizes
   -Added Blocks and Diskkeys to work with -qs
   -Added [-z]  LS style directories for a new look :-)
   -Added big comments and micro comments--letter 'c'-- in LS style
      directories.
   -Once again, another string building enhancement for quicker displays.
   -Added "No files found." output is no files found....duhh!
   -Added Current Directory string to header if applicable.
   -Added [-gb] for you people that want grouped directories *AND* files
    (yepp...just for you Hari Wiguna(aka Harry) and Bill Hogsett)
   
ver 4.7
   -Added vertical column'ed sorting!
   -Added variable column setting with quick option to allow 
    re-directing to printers etc. (132 column wide load moth'as!)
   -Fixed Date output of -d1 or -d2 when using Today deally so the display
    will line up and give correct time formats....
   -Shortened Usage a bunch and added ANTS EE (ANSI).
   -I'm basically making a new version number per new option, so 5.0 will
    be born faster! :-)

ver 4.6
   -Increased printing output by 5%!
   -Rewrote string building routines.  Now a lot faster!
   -Now able to CTRL-C break from Sorting routines!

ver 4.5a
   -Fred Fish release.

ver 4.5  
   -Added [-i] HIDE .info files.
   -Added [-l #] list files since # days.
   -Fixed bug in parsing the simple /*.
   -Altered sorting precedence for theoretical increase.

ver 4.0
   -Added ENV: support!
   -Added [-o] option to ignore ENV:NEWLIST settings.
   -Added Wildcards to -q option.
   -Adjusted Wildcard routine.
   -Tweaked Print routine for BURNIN' displays!
   -Hacked _main.c so Workbench execution will exit properly (and save code
    size!)
   -Pretty lame stuff for a new version, but what else can I add?

ver 3.0
   -Chopped 2.5k from executable!
   -Added Sorts and Reverse to work with -q simple option.

   -Added FULL UNIX style wildcards!  Double star supported! (new*lis*)
   -Its PURE!  Marv Albert would say "Yesssssss!"
   -Added LIST look-a-likes:  TODAY thing, no header opt, Group displays
   -Added some routines from Mark Rinfret's Date Request Package.
   -Sort by date!!
   -Quick Dir option!!
   -Reverse added
   -Blocks, Diskkeys, Comments, and bunches' of date formats.
   -Added option to create your own date string format!
   -Fixed Continual Memory Loss bug!
   -Fixed that pesky DateStamp conversion formula!
   -Added some ANSI.
   -Compiled and compiled and compiled to get the !smallest! version.
   -Code completely optimized my NCEMRSoft staff.
    As Scotty would say 
       "She's goin' as fast as SAS/C will handle captain!
          We can't go any faster!!  AY AY, she's a chuggin'."

ver2.0
   -Added Dynamic List creation so directories of infinite size can
      be viewed (if you have the memory to handle it!  :-)
   -Added sorts by name and size
   -Added Protection bits.

ver1.0
   -The first version.
   -Think of something really lame and you'll be pretty close
    (yeah, McGyver, Milli Vanilli, Geo, and the BLACK SCORPION(ooh)
       are good examples)


~~~~~~~~~~~~~~~~~~~~
FUTURE:
   -Recursive Directories.....
   -Recursive Directory Pattern Matching */.c matches
     dh0:newlist/newlist.c
     dh0:source/tdraw.c
     dh0:what/is/my/name.c

   -Yes Tony....I'm still working on recursive directories.  Problem is
    the recursion  
       1) Will force me to re-write almost the whole thing!!
       2) Will REALLY slow down the algorithms unless I somehow manage
          to find some miracle product on late night TV.
       3) shouldn't be expected till AT LEAST version 5.0!

   -I'm gonna start fiddling with Assembly.  Hopefully I can manage
    to re-write some parts (probably the printing part) to boost speed.
   -Smaller, faster, better,  (yeah right, that's what they all say!)
   -Tell me your needs and improvements and I'll write you a new version!
    Yes, I will write you a personalized version with the features YOU
    want!  Of course, send in the tuitionware requirements first.
   -All future versions will only be created if I have support.
    I'm really trashing out on this.  I want a different project.

    Here's what I MAY put out in the future:

    Version 4.9: Bug fixes and minor enhancements.
    Version 5.0: Recursion and Assembly optimization.
    Version 6.0: Version for A-Cray, A-VAX, and A-PDP11 emulators  
                 for the Amiga :-)

Phil Dietz

~~~~~~~~~~~~~~~~~~~~



   Commodore, this is a plea from your Amiga customers!

   Please re-write "list" to include more features!  "List" in its current
   wb1.3 state is very very lacking in power.  Fortunately, we
   modemers can download newlist49, ls-411jr, arp list, or dr, to replace
   "list".  I'd hate to not own a modem and be stuck with a poor
   list program!

