This is the Cassette Tape Storage Council web site

Don’t quit using compact cassette tapes for computer data storage

Using Mostafa’s app to save files to tape

The Cassette Tape Storage Council has created a bash script to use Mostafa’s piece of software to save files to tape and read them back. Click here to download the script.

This is how you use minimodem to save data to an actual tape.

Dependencies

This script uses: bash, minimodem, sox, tar, pax, ssl (for optional encryption) and base64. Install all these applications before running the tape bash script. Copy the tape bash script to an executable location and give it execution permits. It has only been tested on Linux. It may work also on other Unix-like environments, on UNIX or on Cygwin. Hardware-wise, the script depends on an actual hard disk present on the PC. Unlike computers from the 80s, that loaded directly from tape to RAM, this script interacts heavily with the hard disk. In principle, a SIM card, a pendrive or even a floppy disk will do as well. The saving/loading speed is frustratingly slow. It is slower than Oona Räisänen’s script, than Dave Beazley’s, than the Kansas City Standard, than the ZX Spectrum’s, etc. It is a tradeoff. This is the only way files can be safely loaded back and resist the pass of the months. With the other, faster scripts, files wouldn’t always load back from the tapes, and those which would stopped loading back after some months for some reason.

Saving a file

To save a file or folder, type: $ tape save [name of file] The script will tar the file or folder selected, then zip it, then convert it to base64, then create a wav file for that text file. The script will calculate the length of the file in bytes, seconds and minutes. The script will create a header, in plain text, containing this meta data plus the date of recording. The script will next prompt the user to press REC on the tape recorder and hit Enter. The computer will start playing the sound, which the deck should be recording on a cassette tape. To save a file with ssl encryption, type: $ tape save [name of file] -e You will be prompted for a password. The saving process continues as usual. When invoking the script from a GUI or from any non-interactive environment, the flag –nowait should be used, like so: $ tape save [name of file] –nowait Thus, the script will go on to play the screeching sounds right away, not waiting for the user to hit a key.

Loading a file

To load a file from tape, type: $ tape load A file or folder will be loaded from tape to the present working directory. The script will look for the word “Found” in the header. This is an endless loop, so if the script can’t find the word “Found” it will not even attempt to load the actual file. If the word “Found” is present in the header, the file will load. If the loading process fails, the lovable “Tape loading error” message will be displayed on screen. A plain text, base64, file will be loaded, then converted to a tar.gz file, then unzipped, then expanded. It will be expanded to the present working directory. It will replace any existing files without warning. The files will be copied to the present working directory regardless of the original directory structure of the tar. This script is not suitable for complex and big tars. Then again, this will usually not be a problem, since users will be saving small files anyway. After loading the file or files, the names of the files just loaded will be displayed on the screen. The listing is done by comparing the output of ls before and after loading the files, so if you use the tape script in /tmp you may have scambled results, as temporary files will be also listed. If the file just loaded is a ssl encrypted, the command to decrypt the files is: $ openssl enc -aes-256-cbc -d -in encrypted-file.ssl > loaded.tar.gz But the simple: $ tape -d invokes the former, so saves you from typing the whole command.

Copying a file

To copy a file, type: $ tape copy First you have to provide audio input, just as when loading a file. The file will not be loaded, or rather it will be temporarily loaded unbeknownst to the user. After reading the file, the script prompts the user to swap tapes and to press REC on the cassette deck and hit a key. The file will be played. It will be an exact copy of the original, except that the timestamp of the header will be updated.

Listing a tape

Just as DOS had the dir command or Linux has ls, to list the contents of a tape, or rather one side of a cassette, type: $ tape list Rewind the tape, press PLAY on the deck, and wait until the tape is through playing. The latter command is an infinite loop, so when the tape ends, press Ctrl C. You will find a file named list.txt in your pwd. Move it or rename it before creating a new list on the same location. The script will have created a text file containing all the headers present in the tape and the list of the files inside the tar.

Integrating tape to an ncurses file manager

This script can easily be integrated to Midnight Commander. Which is only natural, since this script is a file manager after all, and Midnight Commander is also a file manager. Their integration is the perfect team. To do so, edit the menu file. Fire up Midnight Commander, press Esc, then 9, then navigate to “Command” then to “Edit menu file”, and choose local or user. I choose user. The menu file opens up in your editor of choice. In that file, just add this chunk:


t       save file or folder to tape
        tape save %f
l       Load file from tape
        tape load

Those are spaces, not tabs. It is ready to use now. In Midnight Commander, place the cursor on the file or folder you want to save, then press F2, then <t>. The script will be invoked in order to save the desired file to tape. To load a file from tape, just press F2, then <l>. It invokes tape load. It can easily be integrated to ranger as well.

Integrating tape to the Thunar GUI file manager

Fire up Thunar. Navigate to “Edit”, then to “Configure custom actions…”, then click on “Add a new custom action”. Name it “Load file from tape”, and in the field named “command” just type “tape load”. Create a new custom action, name it “Save file to tape”, and type “if [ -e %n ]; then tape save %n –nowait; fi” in the “command” field. The script is ready to be invoked by right-clicking with the mouse. The downside is that the user will not have feedback about the loading or saving process. About which I don’t care very much. Use a tty or a terminal emulator.