--- title: "Disk Eraser" type: "article" slug: "disk-eraser" url: "http://localhost/article/disk-eraser/" markdown_url: "http://localhost/article/disk-eraser.md" published_at: "2025-11-27T13:21:05+00:00" modified_at: "2026-06-21T23:25:46+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "In one of my program idea brainstorming sessions, I came up with the idea of writing a program to completely erase a floppy disk. The idea comes from government regulations. When deleting classified information from a disk, the disk must be written with all 1's, then all 0's, and then random 1's and 0's. After…" category: - name: "QL Hacker's Journal" slug: "ql-hackers-journal" taxonomy: "category" url: "http://localhost/category/periodicals/ql-hackers-journal/" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "QL" slug: "ql" taxonomy: "post_tag" url: "http://localhost/tag/ql/" - name: "Superbasic (programming language)" slug: "superbasic-programming-language" taxonomy: "post_tag" url: "http://localhost/tag/superbasic-programming-language/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Sinclair QL" slug: "sinclair-ql" taxonomy: "model" url: "http://localhost/model/sinclair-ql/" indiv: - name: "Herb Schaaf" slug: "herb-schaaf" taxonomy: "indiv" url: "http://localhost/indiv/herb-schaaf/" - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" publication_r: id: 33686 title: "QL Hacker’s Journal" type: "periodical" url: "http://localhost/periodical/ql-hackers-journal/" authors_r: - name: "Tim Swenson" slug: "tim-swenson" taxonomy: "indiv" url: "http://localhost/indiv/tim-swenson/" - name: "Herb Schaaf" slug: "herb-schaaf" taxonomy: "indiv" url: "http://localhost/indiv/herb-schaaf/" issue: "11" issues_articles: - id: 61547 title: "QL Hacker’s Journal 11" type: "issue" url: "http://localhost/issue/ql-hackers-journal-11/" pubdate: "November 1992" archive_link: true --- # Disk Eraser In one of my program idea brainstorming sessions, I came up with the idea of writing a program to completely erase a floppy disk. The idea comes from government regulations. When deleting classified information from a disk, the disk must be written with all 1’s, then all 0’s, and then random 1’s and 0’s. After this, the disk can be re-formatted and considered clean enough for unclassified use. It has been shown that reformatting a disk will not delete all of the information. Some bit patterns will remain, although they will be faint. The above procedure ensures that enough writes happen to the disk to completely wipe out any bit patterns on the disk. To implement this program, I looked at Herb Schaaf’s Diskinfo program (QHJ #2). I got a few things figured out by looking at the code, but not enough to really give the program a try. I have Herb a call to see if he would help me on the program, or write it himself. Herb, always ready to accept a challenge, sent me the program a few days later. I have taken what Herb wrote and made it more procedural and added a few touches of my own. As is, the program will only write 1’s and 0’s. Adding the random 1’s and 0’s should be fairly easy to do if you really want to use this program. Just as with a data encryption program, I don’t think that my QL users will really need to use this program. It’s just a good exercise in programming and does demonstrate how to address every sector of a disk. ``` ** wipedisk_ssb ** ** This program will write all 0's then all 1's ** to a disk and then format it. This is designed ** to totally delete all information from the disk. ** A format does not always delete the information ** at the lowest levels. ** ** Government regulations decrea that all disks ** that contain classified information go through ** a program like this to guarrentee that all of ** the information is gone for good. BORDER #3,1,4 PAPER #3,2 : INK #3,1 : CLS #3 ** TK2_EXT ** Write 0's to the whole disk PRINT #3,"Writing Zero's To Disk" null$ = FILL$(CHR$(0),512) wipe (null$) AT #3,6,0 : PRINT "Done" PAUSE 200 CLS #3 ** Write 1's to the whole disk PRINT #3,"Writing One's To Disk" full$ = FILL$(CHR$(255),512) wipe (full$) AT #3,6,0 : PRINT #3,"Done" PAUSE 200 CLS #3 PRINT #3,"Formating Disk" FORMAT "flp2_" PRINT #3,"Disk Formatted" STOP DEFine PROCedure wipe (string$) LOCal side, sector, track, in$ OPEN #4,'flp2_*d2d' FOR track = 0 TO 79 FOR side = 0 TO 1 FOR sector = 1 TO 9 PUT #4\sector+(side*256)+(track*65536),string$ AT #3,1,2: PRINT #3,"Track : ";track AT #3,2,2: PRINT #3,"Side : ";side AT #3,3,2: PRINT #3,"Sector: ";sector END FOR sector END FOR side END FOR track CLOSE #4 END DEFine PROCedure wipe ```