RAWDISK
=========
Overview
Rawdisk is a program which enables you to write to the raw media of
a floppy disk (or a series of floppies if need be). It makes most
sence to put rawdisk at the start or end of a command pipeline.
Licence & Warranty Information
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Installation Instructions
Rawdisk needs to be able to open the /dev/rfd?a devices to read and
write to raw floppies. You can do this by either installing it
as setuid root or set-gid operator and modifying the /dev/rfd?a devices
to be writable (as well as readable which they should be already) by
operator. Being of a nervous disposition, I did the latter, something
like:
su
mkdirs /usr/local/bin
mv rawdisk /usr/local/bin
chown root.operator /usr/local/bin/rawdisk
chmod g+s /usr/local/bin/rawdisk
chmod g+w /dev/rfd?a
exit
rehash
Using rawdisk
Rawdisk spews directly to the raw media, hence its name. Doing this
*destroys any filesystem on the disk* SO BEWARE. Do not try
to put the disk in before running the program, when rawdisk wants
a disk, it will ask for it. If outside of rawdisk you insert a disk with
raw data on it, auto-mounter will think it's a damaged disk and offer
to repair it. If there is already a disk in the drive when rawdisk runs
it will be ejected (but not unmounted!).
When spewing to multiple disks it writes *NO* markers for first, second,
third disk etc. THIS IS UPTO YOU! Thus when reading disks, giving the
disks out of sequence will happily shuffle your data in disk sized chunks.
Rawdisk does not write end of file markers. When reading disks, it will
read until it is killed or its output pipe is broken or cancel is clicked
in the disk request dialog box. This is fine for use with programs like
tar which know when they have reached the end.
Example usage:
Backing up
tar cf - myfiles | compress -c | rawdisk -w # write archive
rawdisk -w | uncompress -c | tar tvf - # verify archive
rawdisk -w | uncompress -c | tar xvf - # read archive
Copying a disk
- this seems to work, but don't use it for something vital!
rawdisk -r > disk-image
(click CANCEL when it asks for a second disk)
rawdisk -w < disk-image
rm disk-image
Source Code
I don't usually write C, so sorry if the code is a little strange. I wrote
a wierd sort of exception handler (I didn't know about NX_RAISE) to
handle OS call errors and ensure that if a disk is in the drive it is
ejected before the program terminates. It should have more comments,
but I wrote it for me.
Finally
I hope you like it. It could do with a few tune-ups. If you make any
changes or find any bugs I'd like to hear from you. If you'd like to
help me out, but don't want to hack code, write me a man page!
REMEMBER, RAWDISK MAY HAVE BUGS IN IT SO USE IT AT YOUR OWN RISK.
Richard O'Neill
Computing Science Dept.
Simon Fraser University
Burnaby BC
V5A 1S6 CANADA
oneill@cs.sfu.ca
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.