[net.micro.cbm] undocumented 1541 features

lenoil@mit-eddie.UUCP (Robert Scott Lenoil) (03/31/85)

[This article originated from Dave Funk (decvax!zinfandel!dave), but his
 attempts to post it have all met with failure.]

Due to popular demand, here are some little known features that your 
1541 drive is capable of:

1.  Scratch-proofing files (I like this one!)

Byte 2 (starting from byte 0) of the directory entry for a 
given file contains the file type.  This information is on
track 18, sector 0. To wit:

	$80	DELeted
	$81	SEQuential
	$82	PRoGram
	$83	USeR
	$84	RELative

To scratch-proof a file, just change the '8' to a 'C'.  This
sets bit six in byte number two.  Now when you cat the disk,
you will see a '<' after the file type.  If you try to scratch
it, you will not get an error, but the file is NOT actually
scratched.  If you do another cat, it is still there just like
it always was.  The only way to scratch it now is 1) reset bit
six or, 2) 'new' the disk.  Pretty neat, huh?

Now, how does one do this?  I suppose you could figure out a 
way to send a command to the disk drive, but I just used a 
disk editor.  RUN magazine published one a few months ago --
I used CLONE (a commercial disk copier/editor).


2.  Anti-knock compound (or how to make your drive stop banging
    itself on the stop).

I run this little program just prior to loading software that likes
to bang the drive:

OPEN15,8,15:PRINT#15,"M-W";CHR$(106)CHR$(0)CHR$(1)CHR$(133):CLOSE15


3.  Trashed files

If a file has been improperly closed, you normally can't reopen it
and repair it.  You can tell if you have one of these when you catalog
the disk.  An asterisk will appear next to these files.  To open these
types of files, you need to specify 'M' when opening them.

Example:

OPEN3,8,3,"TRASHFILE",S,M

You can now open and read (and hopefully recover) TRASHFILE.


4.  Append to files

It is possible to append to existing (non-random) files by opening them 
with the 'A' command.  

Example:

OPEN3,8,3:"OLDFILE",S,A


5.  Concatenate files

It is possible to concatenate up to four files with one command.

Example:

OPEN3,8,3:"C0:BIGFILE=1FILE,2FILE,3FILE,4FILE"


6.  Opening files

If you specify that the file you are opening is type 'M', it will match
any type of file.

Example:

OPEN3,8,3:"FOOFILE",M,R

This will open *any* type of file for reading.



That's it...  Have fun!

- dave - 

Dave Funk
Zehntel, Inc.
2625 Shadelands Drive
Walnut Creek, CA  92598
(415) 932-6900 x309

     ....!decvax!sytek!zehntel!dave
     ...."zehntel!dave"@BERKELEY