home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
misc_utils
/
newlist
/
newlist.doc
< prev
next >
Wrap
Text File
|
1991-03-08
|
12KB
|
278 lines
NewList 4.5
by
Phil Dietz
10542 Cuming Street
Omaha, Nebraska
68114
10-Feb-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. After I finished newlist, I checked out LS offered
for the Amiga. Yeah, it's real similar. All the flags and stuff
(except letter filters! and date creation!) but trust me, LS isn't the
best. The biggest problem with LS is that the code NEEDS TO BE
OPTIMIZED! All sorts of nasty dirty lookin' booger pickin' stuff was
in it. Stack consuming non-dynamic arrays, global variables, GOTOs,
and alot of little things. 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 O' Flags and Switches!
Usage: NewList ?
NewList [-o] [-a] [-b] [-k] [-d01234] [-df "DATE STRING"] [-r] [-sn|-ss|-sd]
[-gd|-gf] [-n] [-h] [-c] [-fA] [-tZ] [-i] [-l #] [-q]<path and wild>
[-o] Overlook ENV:NEWLIST settings. Must be first position!
[-a] DONT translate day to Today, Yesterday, etc. if applicable.
[-b] [-k] Displays BLOCKS, DiskKEYS, or by default filesize.
[-d01234] Five different Date/Time Formats.
[-df] Date Format string. See documentation.
[-r] Displays list in REVERSE order from bottom<->top.
[-sn] Sorts by name. Same as [-s].
[-ss|-sd] Sorts by Size or by Date respectively.
[-gd] [-gf] Groups display to show ONLY dirs or ONLY files.
[-n] Displays COMMENTS if available.
[-h] No Header Displayed.
[-c] CASE is checked so only lower or upper case are shown.
[-f] or [-t] MUST be set to an alphabet letter to work.
[-fA] [-tZ] Displays only files that start with letters from A to Z.
[-i] Ignore .info files!
[-l #] Only display files made in the last # days.
[-q] Quick and simple directory. (ONLY -snds/-r/-i/-l allowed).
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. This flag MUST be in the first
position (ie newlist -o ram:).
[-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.
Simply make a C string like printf.
"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!!
[-gd -gf] Groups the display so ONLY dirs or ONLY files are shown
respectively. This is an option of LIST I had to add.
[-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)
[-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.
<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 together (-q has exceptions)
and in any order. newlist dh0: -s -r = newlist -s dh0: -r
Thus you can view a directory through a case sensative character filter,
sorted by date in reverse order, total blocks used, with a
custom dateformat string, hiding .info files, and 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.
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)
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-Linc, U of Neb-Oma, U of Texas,
MSstate, Iowa State, and others!
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