Jump to content
IGNORED

How to delete all the files on a disk?


Link6415

Recommended Posts

Two ways:

 

PRINT#1,"S0:*"

would delete all files except protected ones. This is probably not want you want.

 

PRINT#1,"N0:DISK NAME,ID"

would reformat the disk in its entirety, which probably is what you want. If you leave out the ID parameter, it is faster but not as complete reformat.

  • Like 1
Link to comment
Share on other sites

Two ways:

 

PRINT#1,"S0:*"

would delete all files except protected ones. This is probably not want you want.

 

PRINT#1,"N0:DISK NAME,ID"

would reformat the disk in its entirety, which probably is what you want. If you leave out the ID parameter, it is faster but not as complete reformat.

Right, as usual :twisted: . You can save a little time by using the CBM DOS Wedge with:

@command     Execute a disk drive command (e.g. f0:diskname, V0:, I0:)

and, if you have a fast loader cartridge, you can really speed up the process.

But, this all boils down to the basic format command.

Link to comment
Share on other sites

Yes, or you could load a standalone fast formatting program if you have a lot of disks to format in one session. Before I got my AR6, I seem to recall to use the fast formatting function in some copying program, but then you need to factor in the time it takes to load said program and swap floppy disks.

Link to comment
Share on other sites

It's funny how Commodore didn't plan well. With most other computer, formatting, adding new files, deleting, etc are usually easy to remember. But with Commodore computers you need convoluted long command to format (and to close it properly). Need another one to delete old file. Got a splat (*) file? Need another command to fix that. Even Commodore computer can't tell what is wrong when there's drive error other than an useless error message so you need to open and read the disk drive to get a more useful error number and code to find out what went wrong.

 

It didn't help that people screwed up a couple minor things that hobbled the drive's throughput speed. There was a timing error with certain chip that prevented C64 from going fast, and a little mistake removed the high speed wire, similar to what C128 and 1571 has and the result is disk speed is a bit slower than the older 1540 and Vic-20.

 

PS forgot there was a weird screw up long ago when I was trying to organize a few BASIC programs. One of them was visible on disk directory but had file type DEL, which shouldn't be possible. PRG, REL, and SEQ are typically all I see on normal disks. Oddly with an unusual command, I could load and run DEL file like it was a PRG file. Which mean I had a file that even my brother can't figure out how to load or run. :D I can't remember how I got it but I think it's a documented "feature"

Edited by 7800fan
  • Like 1
Link to comment
Share on other sites

BASIC 4 on the PET has more verbose commands for disk handling, but due to space limitations Commodore decided to go back to BASIC 2 on the VIC and C64. So it isn't entirely true that Commodore didn't "plan well", just that they decided to save money / use resources on other things instead.

 

When it comes to file types, there is also USR. I can agree that it is an anomaly to see DEL< files (protected to avoid deletion) but why this makes it a bad system - like how I interpret your message - is beyond me.

  • Like 1
Link to comment
Share on other sites

It's not a bad system, just unusual. On most computers, deleted are deleted but on Commodore, deleted files that are not really deleted shows up and it can confuse less experienced people into thinking their disk is going bad or some gremlin has invaded the disk drive.

 

They should have included disk command from 4.0 when they went with 2.0 for V20 and 64 because the disk drive were more popular in USA and some people still had to look up the book now and then or have a few sticky notes plastered on their monitor for the disk command.

 

JiffyDOS and some fast loader carts help a lot there by adding in a few easy commands.

Link to comment
Share on other sites

Well, normally what happens when you delete a file - and this applies on MS-DOS FAT etc as well - is that the directory entry is blanked out and BAM marks blocks as available. Sometimes only a few bytes need to change on the disk, which is why undelete functions are quite feasible if you have not made any other changes to the disk.

 

When you delete files on a 1541, they don't show up as DEL, they just don't show up at all. However you can modify the directory in such way that existing files are given the file type of deleted. If I recall correctly, the next time you validate the disk, those files will be deleted for real unless you also protect the files which is indicated with a less-than "<" symbol. You can protect PRG, SEQ, USR, REL from being deleted as well, which is the normal use.

 

Mostly I think this practise was used by cracker and demo groups who like to embellish the directory listing with blank lines, credits, PETSCII graphics etc. They then create directory entries which are 0 blocks long, of the DEL file type and protected from deletion, and use the file name field to add text or graphics. As you may have observed, you can also include various control codes into file names, like CLR/HOME and codes for breaking the listing. I'm not sure how those appear if you use a wedge to read the data directly from the drive, but if you LOAD"$",8 and use LIST, BASIC will interpret those codes.

Regarding the syntax, remember that you can PRINT#1,"NEW0:DISK NAME" or "SCRATCH0:*" instead of using the abbreviated commands. On the 1541, you may even leave out the zero (which indicates drive number 0 on a dual drive, which is a heritage from the PET) which makes the syntax just as easy:

 

OPEN 1,8,15,"NEW:MY DISK,DD":CLOSE 1

instead of

HEADER:MY DISK,DD

 

On many other systems you might have to load a program off a disk in order to format another disk. To me that is a bigger oversight than sending commands to the drive in form of strings instead of implementing those directly as BASIC commands.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...