[Coco] Mass-extraction of DSK images.

Tormod Volden lists.tormod at gmail.com
Wed Jul 12 19:05:22 EDT 2017


Mathieu, there is already a "split" command to do exactly that:

split --numeric-suffixes=1 --suffix-length=3 --additional-suffix=.DSK
--bytes=161280 orig.dsk DISK

Anyway I believe the OP wanted more than just to split multi-disk
images, rather extracting the files inside the disk images, which was
what Guillaume's script did.

Tormod


On Tue, Jul 11, 2017 at 5:32 PM, Mathieu Bouchard wrote:
>
> I don't know whether you still want that, as Guillaume sent you a Windows
> shell script, but you say you have a Mac. I made a Linux shell script for
> that, which probably works on Mac too. It doesn't use toolshed, it just cuts
> any file into chunks of 161280 bytes. If you give it "FOO.DSK" it will
> create "FOO/000.DSK", "FOO/001.DSK", and so on.
>
> #!/bin/bash
> if [ "$1" = "" ]; then echo "error: dsk name missing"; exit 1; fi
> DEST=$(basename "${1%.*}")
> mkdir "$DEST" || exit 2
> last=$[$(stat -c%s "$1")/161280 - 1]
> for i in $(seq 0 $last); do
>   dd if="$1" of="$DEST/$(printf %03d "$i").dsk" bs=161280 skip="$i" count=1
> done
>
>
> Le 2017-02-05 à 13:29:00, Allen Huffman a écrit :
>
>> Does anyone know how to mass extract DSK images in to directories? I


More information about the Coco mailing list