home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / misc / 23534 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.5 KB  |  79 lines

  1. Newsgroups: comp.sys.next.misc
  2. Path: sparky!uunet!wupost!csus.edu!netcom.com!netcomsv!yamanote!gordie
  3. From: gordie@cyclesoft.com (Gordie Freedman)
  4. Subject: Re: how to read a (ie: 'tar') floppy?!?
  5. Message-ID: <1993Jan6.060123.3560@netcom.com>
  6. Sender: gordie@netcom.com
  7. Reply-To: gordie@cyclesoft.com
  8. Organization: Dolphin Software
  9. References: <1id1irINNmr8@anthrax.solbourne.com>
  10. Date: Wed, 6 Jan 1993 06:01:23 GMT
  11. Lines: 66
  12.  
  13. In article <1id1irINNmr8@anthrax.solbourne.com> hanzel@solbourne.com (Karl  
  14. Hanzel) writes:
  15. > Ok, i give up...
  16. > What's the secret to being able to stuff (just for example) a 'tar' floppy
  17. > into a NeXT's drive and then to read it?  The scenario is this:  i'm here
  18. > pax,
  19. >    Karl
  20. >    *----->
  21. >    (NeXT Mail to karl@khaos.com, thanks!)
  22.  
  23. Note: This answer, or a better one should probably go into the FAQ, this  
  24. question (and other related ones, such as "my floppy is stuck I can't eject  
  25. it") is asked a lot.
  26.  
  27. When you use the tar command from the shell, specify /dev/rfd0b (for example to  
  28. read the table of contents on a floppy: "tar tf /dev/rfd0b"). The man page on  
  29. tar goes into more detail about the specifics. Don't insert the floppy, just  
  30. type your tar command, and NeXTSTEP will politely ask you to insert the disk.
  31.  
  32. Now, you need to set the permissions on /dev/rfd0b to rw for whoever is using  
  33. it. To do everyone (note /dev/rfd0b is owned by root):
  34.  
  35. % chmod 666 /dev/rfd0b
  36. % ls -alsx /dev/rfd0b
  37.    0 crw-rw-rw-  1 root      41,  1 Nov  4 10:23 /dev/rfd0b
  38. %
  39.  
  40. If you don't want to set the permissions, you have to run tar as root.
  41.  
  42. To eject the disk, there is a command somewhere, sorry I can't remember what it  
  43. is. However, a bit of hacking will get it ejected for you (see man page on fd  
  44. et al for more info).
  45.  
  46. Here's a program, name the source eject.m and do what the comments say.
  47.  
  48. -------------cut for eject.m-----------------
  49. #include <stdio.h>
  50. #include <sys/file.h>
  51. #include <bsd/dev/disk.h>
  52. #include <bsd/dev/fd_extern.h>
  53.  
  54. // save this file as eject.m
  55. // % make eject        # Make a binary (no makefile required)
  56. // % strip ./eject    # Shrink the binary
  57. // % ./eject         # to eject the disk
  58. // As long as /dev/rfd0b is crw-rw-rw- this will work, else
  59. // run this program as root.
  60.  
  61. void
  62. main (int argc, char** argv)
  63. {
  64.     int fd = open ("/dev/rfd0b", O_RDONLY,  0);
  65.     ioctl (fd, DKIOCEJECT);
  66.     close (fd);
  67.     exit (0);
  68. }
  69.  
  70. -----------------end eject.m-------------
  71. -- 
  72.  
  73. --- Gordie Freedman gordie@cyclesoft.com  NeXTMail Yes! ---
  74. >>> Thou shalt not inline functions more complicated than 20 
  75.  
  76.