[net.micro.amiga] FASTDIR

robp@amiga.UUCP (Robert A. Peck) (05/13/86)

I've posted to net.sources a shar archive for FASTDIR.   Here is an
extract from its doc.file:

/* Fastdir was designed to be a faster implementation of the "DIR" command
 * for directories that have a large number of items in them, such as c:
 *
 * It is implemented as follows:
 *
 *      command:  FASTDIR
 *      or        FASTDIR <pathname>
 *
 * If there is a file by the name ".dir" in the selected or current path
 * name, fastdir checks the creation date of this .dir file (stored as the
 * first line in the file itself) against the modification date of its
 * parent directory.  If they match exactly, it means that ".dir" contains
 * the (near) equivalent of somebody doing a command "DIR > .dir" within this
 * directory.  If the creation/modification dates don't match, fastdir
 * attempts to create such a file.  After either finding or creating
 * this file, it copies ".dir" to the standard output.
 *
 * Fastdir does not implement the "OPT" option.
 *
 * Fastdir modifies the DIR output slightly in that directories are NOT
 * listed separately, but are merged alphabetically into the normal
 * sorted alpha listing, still marked " (dir)" as they should be marked.
 *
 */

 
DISCLAIMER:
 
        This program is provided as a service to the programmer
        community to demonstrate one or more features of the Amiga
        personal computer.  These code samples may be freely used
        for commercial or noncommercial purposes.
 
        Commodore Electronics, Ltd ("Commodore") makes no
        warranties, either expressed or implied, with respect
        to the program described herein, its quality, performance,
        merchantability, or fitness for any particular purpose.
        This program is provided "as is" and the entire risk
        as to its quality and performance is with the user.
        Should the program prove defective following its
        purchase, the user (and not the creator of the program,
        Commodore, their distributors or their retailers)
        assumes the entire cost of all consequent damages. 

Hope this helps.

robp.

page@ulowell.UUCP (Bob Page) (05/15/86)

In article <1146@amiga.amiga.UUCP> Robert A. Peck writes:
>Followup-To: Questions re slow DIR command
Nope.  The Followup-To: line is the newgroups to follow up to (what you
get when you type 'F'.)  You usually leave it blank except when you
want further discussion redirected to a certain newsgroup.  You might
want to put further summary lines in a field called Summary:

>I've posted to net.sources a shar archive for FASTDIR.

This appears on the programmer's toolkit disk from C-A.  I tried it,
and have some comments:
   I don't see how it is any faster than dir!
   I'm glad it doesn't print the dirs seperately.
   It should DELETE the .dir file after it is done!
   *******
   Under V1.2, if the disk fills while writing the .dir file, you
have just hung your CLI process.  FASTDIR doesn't know that the
disk is full, and retries its write.  Of course, you get another
"Volume foo is full" requester, and the cycle starts again.
I didn't try this under V1.1.

    Thanks for the directory read code, though.

..Bob
-- 
UUCP: wanginst!ulowell!page	Bob Page
ARPA: page@ulowell.CSNET 	U of Lowell CS Dept
VOX:  +1 617 452 5000 x2233	Lowell MA 01854 USA

robp@amiga.UUCP (Robert A. Peck) (05/16/86)

The source code to FASTDIR expressly states its purpose and its limitations -
purpose: to build a .dir file that is SUPPOSED TO STAY THERE ON DISK (primarily
for the C: directories and anything large, so as to save the search time through
the links of files, and print the .dir file itself instead of doing the search
if nothing has changed in the directory in the meantime.

As for limitations, it also states that there is no error check for a too-full
disk.  I managed to post this code to net.sources but found this error not
in time to fix it but at least to report it so someone else on the net could
actually fix it.  

The code IS faster on FASTDIR C: as well as any other directory where there
are massive numbers of files perhaps scattered across the disk.   

I am no longer directly associated with Amiga and may have a difficult time
in gaining further access to the net.  I'll be attending the BADGE meetings
whenever possible and hope to continue to support the Amiga as a developer.

Thanks, folks, for making net.micro.amiga a very interesting place to be.


Regards,

Rob Peck.


ps.  Messages left for me at Amiga will be forwarded to me.   thx.

cem@intelca.UUCP (05/19/86)

In article <335@ulowell.UUCP> Bob Page writes ...
> 
> This appears on the programmer's toolkit disk from C-A.  I tried it,
> and have some comments:
>    I don't see how it is any faster than dir!
>    I'm glad it doesn't print the dirs seperately.
>    It should DELETE the .dir file after it is done!
>    *******
>    Under V1.2, if the disk fills while writing the .dir file, you
> have just hung your CLI process.  FASTDIR doesn't know that the
> disk is full, and retries its write.  Of course, you get another
> "Volume foo is full" requester, and the cycle starts again.
> I didn't try this under V1.1.
> 
> ..Bob

Bob, the bug is valid, however the whole purpose of the dang thing is to
leave the .dir file around! If it has a later creation date/time than
the modification date on the dir handle then fastdir simply dumps the file
at you. This is a lot faster than doing a DIR sometimes. Lets get serious
here.

--Chuck
-- 
                                            - - - D I S C L A I M E R - - - 
{ihnp4,fortune}!dual\                     All opinions expressed herein are my
        {qantel,idi}-> !intelca!cem       own and not those of my employer, my
 {ucbvax,hao}!hplabs/                     friends, or my avocado plant. :-}