dsktool
Extracting Files From Disk Images

The -e or—extract option extracts a single file from a disk image.

The extracted file will either be displayed on the screen, or it can be written to a file by using the ”-o” or ”—output” command to specify a filename to extract the file into.

Example 1: – Cataloging a DOS 3.3 disk and then showing a Text file

jonno@ubuntu:~/disks$ dsktool.rb -c computist_starter_kit_v2.02.dskcomputist_starter_kit_v2.02.dsk
sector order:   physical
filesystem: dos
 T 0256 CAPTURE
 T 0768 CHANGES
 B 0256 CHECKBIN
 B 0256 CHECKSOFT
 A 2560 COMPUTIST'S STARTER KIT 2.02
 A 5376 CONTROLLER WRITER
 A 4352 CORE DISK SEARCHER
 B 0512 CSAVER
 A 9472 DISKEDIT
 B 1024 DOC VIEWER
 T 7936 DOC.CONTROLLER WRITER
 B 4352 DOC.CORE DISK SEARCHER
 B 13312 DOC.DISKEDIT
 B 7168 DOC.DOS ALTERER
 B 23552 DOC.SUPER IOB
 B 11264 DOC.THE NIBBLER
 A 7680 DOS ALTERER
 T 0256 FAST.CON
 B 0256 IOB.OBJ0
 T 0512 NEWSWAP.CON
 B 0256 OBJ.LINE 10
 B 0256 OBJ.TITLE SEQUENCE
 B 1024 PIC.TITLE
 B 0256 SEARCH.OBJ
 T 0512 STANDARD.CON
 T 0256 START
 A 3840 SUPER IOB
 T 0512 SWAP.CON
 A 4352 THE NIBBLER
jonno@ubuntu:~/disks$ dsktool.rb -e changes computist_starter_kit_v2.02.dsk
    In the starter kit, there have been some changes. These changes are listed below.

1...The differences between version 2 and version 2.01 is that in
the print routine prompts in version 2 asked for left and right
margins, and version 2.01 now asks for left and right indent.
It (version 2.01) now asks for maximum characters per line and it
also shows what should normally be entered for this. It also
shows the usual number of lines per page.

2...The differences between version 2.01 and 2.02 is that the
program "Controller Writer" and its document file are now
included on the Starter Kit.

jonno@ubuntu:~/disks$


For “tokenised” files (Applesoft Basic?, Integer Basic?,[[SCASM],NADOL Files?), the default behavior is to detokenise the file (i.e. into the format that it would show in if you did a LIST command on the Apple).

Example 2 – displaying the “HELLO” Applesoft Basic? file from a deprotected “Temple of Apshai” disk image:

jonno@ubuntu:~/disks$ dsktool.rb -e hello  http://jamtronix.com/dsks/apshai.dsk.gz
5 REM  TEMPLE 20920
6 REM  MODIFIED FOR TITLES
20 POKE 103,1: POKE 104,96
25 POKE 24576,0
30 PRINT CHR$ (4)"RUN TITLE" 
jonno@ubuntu:~/disks$

If for some reason, it is desired to have the original file extracted unaltered then the ”-r” or ”—raw” option can be added to the ”—extract” command.

Example 3 – extracting the “HELLO” Applesoft Basic? file from a deprotected “Temple of Apshai” disk image into a raw file:

jonno@ubuntu:~/disks$ dsktool.rb -e hello  -o hello.bin --raw http://jamtronix.com/dsks/apshai.dsk.gz
jonno@ubuntu:~/disks$ hexdump -C hello.bin
00000000  64 00 14 60 05 00 b2 20  54 45 4d 50 4c 45 20 32  |d..`... TEMPLE 2|
00000010  30 39 32 30 00 2e 60 06  00 b2 20 4d 4f 44 49 46  |0920..`... MODIF|
00000020  49 45 44 20 46 4f 52 20  54 49 54 4c 45 53 00 41  |IED FOR TITLES.A|
00000030  60 14 00 b9 31 30 33 2c  31 3a b9 31 30 34 2c 39  |`...103,1:.104,9|
00000040  36 00 4e 60 19 00 b9 32  34 35 37 36 2c 30 00 63  |6.N`...24576,0.c|
00000050  60 1e 00 ba e7 28 34 29  22 52 55 4e 20 54 49 54  |`....(4)"RUN TIT|
00000060  4c 45 22 00 00 00 4c 00  00 00 00 00 00 00 00 00  |LE"...L.........|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000100
jonno@ubuntu:~/disks$


Next: Initializing Disk Images