home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / misc / 23537 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.6 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!chx400!josef!kluge
  2. From: kluge@avalon.physik.unizh.ch (kluge daniel)
  3. Newsgroups: comp.sys.next.misc
  4. Subject: Re: how to read a (ie: 'tar') floppy?!?
  5. Message-ID: <1993Jan6.114733.21118@ifi.unizh.ch>
  6. Date: 6 Jan 93 11:47:33 GMT
  7. References: <1993Jan6.060123.3560@netcom.com>
  8. Sender: news@ifi.unizh.ch (USENET News Admin)
  9. Organization: University of Zurich, Department of Computer Science
  10. Lines: 42
  11. Nntp-Posting-Host: avalon
  12. X-Newsreader: TIN [version 1.1 PL8]
  13.  
  14. Gordie Freedman (gordie@cyclesoft.com) wrote:
  15.  
  16. : -------------cut for eject.m-----------------
  17. : #include <stdio.h>
  18. : #include <sys/file.h>
  19. : #include <bsd/dev/disk.h>
  20. : #include <bsd/dev/fd_extern.h>
  21.  
  22. : // save this file as eject.m
  23. : // % make eject        # Make a binary (no makefile required)
  24. : // % strip ./eject    # Shrink the binary
  25. : // % ./eject         # to eject the disk
  26. : // As long as /dev/rfd0b is crw-rw-rw- this will work, else
  27. : // run this program as root.
  28.  
  29. : void
  30. : main (int argc, char** argv)
  31. : {
  32. :     int fd = open ("/dev/rfd0b", O_RDONLY,  0);
  33. :     ioctl (fd, DKIOCEJECT);
  34. :     close (fd);
  35. :     exit (0);
  36. : }
  37.  
  38. : -----------------end eject.m-------------
  39. : -- 
  40.  
  41. Ok, the command is disk -e <raw-device>
  42. We use the following script:
  43.  
  44. #!/bin/sh
  45. /usr/etc/disk -e /dev/rfd${1:-0}b
  46.  
  47. : --- Gordie Freedman gordie@cyclesoft.com  NeXTMail Yes! ---
  48. : >>> Thou shalt not inline functions more complicated than 20 
  49.  
  50. - daniel 
  51. --
  52. Daniel G. Kluge @ Swiss Federal Institute of Technology Zuerich
  53. E-Mail              : kluge@avalon.physik.unizh.ch (NeXT-Mail welcome)
  54. study-related stuff : dankluge@iiic.ethz.ch
  55. DECnet              : EZINFO::CLUESCH
  56.