Article View: comp.sys.next.misc
Article #4704Re: how to read a (ie: 'tar') floppy?!?
From: Gordie Freedman
Date: Wed, 06 Jan 1993 06:01
Date: Wed, 06 Jan 1993 06:01
65 lines
2628 bytes
2628 bytes
In article <1id1irINNmr8@anthrax.solbourne.com> hanzel@solbourne.com (Karl
Hanzel) writes:
> Ok, i give up...
>
> What's the secret to being able to stuff (just for example) a 'tar' floppy
> into a NeXT's drive and then to read it? The scenario is this: i'm here
> pax,
> Karl
> *----->
>
> (NeXT Mail to karl@khaos.com, thanks!)
>
Note: This answer, or a better one should probably go into the FAQ, this
question (and other related ones, such as "my floppy is stuck I can't eject
it") is asked a lot.
When you use the tar command from the shell, specify /dev/rfd0b (for example to
read the table of contents on a floppy: "tar tf /dev/rfd0b"). The man page on
tar goes into more detail about the specifics. Don't insert the floppy, just
type your tar command, and NeXTSTEP will politely ask you to insert the disk.
Now, you need to set the permissions on /dev/rfd0b to rw for whoever is using
it. To do everyone (note /dev/rfd0b is owned by root):
% chmod 666 /dev/rfd0b
% ls -alsx /dev/rfd0b
0 crw-rw-rw- 1 root 41, 1 Nov 4 10:23 /dev/rfd0b
%
If you don't want to set the permissions, you have to run tar as root.
To eject the disk, there is a command somewhere, sorry I can't remember what it
is. However, a bit of hacking will get it ejected for you (see man page on fd
et al for more info).
Here's a program, name the source eject.m and do what the comments say.
-------------cut for eject.m-----------------
#include <stdio.h>
#include <sys/file.h>
#include <bsd/dev/disk.h>
#include <bsd/dev/fd_extern.h>
// save this file as eject.m
// % make eject # Make a binary (no makefile required)
// % strip ./eject # Shrink the binary
// % ./eject # to eject the disk
// As long as /dev/rfd0b is crw-rw-rw- this will work, else
// run this program as root.
void
main (int argc, char** argv)
{
int fd = open ("/dev/rfd0b", O_RDONLY, 0);
ioctl (fd, DKIOCEJECT);
close (fd);
exit (0);
}
-----------------end eject.m-------------
--
--- Gordie Freedman gordie@cyclesoft.com NeXTMail Yes! ---
>>> Thou shalt not inline functions more complicated than 20
Technical Details
Message-ID:
<1993Jan6.060123.3560@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!csus.edu!netcom.com!netcomsv!yamanote!gordieReferences:
<1id1irINNmr8@anthrax.solbourne.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.misc Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!csus.edu!netcom.com!netcomsv!yamanote!gordie From: gordie@cyclesoft.com (Gordie Freedman) Subject: Re: how to read a (ie: 'tar') floppy?!? Message-ID: <1993Jan6.060123.3560@netcom.com> Sender: gordie@netcom.com Reply-To: gordie@cyclesoft.com Organization: Dolphin Software References: <1id1irINNmr8@anthrax.solbourne.com> Date: Wed, 6 Jan 1993 06:01:23 GMT Lines: 66