home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / wizards / 3885 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.1 KB  |  32 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!world!bzs
  3. From: bzs@ussr.std.com (Barry Shein)
  4. Subject: Re: Programmatic recgonition of sun floppy device
  5. In-Reply-To: gfong@bellahs.com's message of Thu, 10 Sep 1992 01:11:22 GMT
  6. Message-ID: <BZS.92Sep10215513@ussr.std.com>
  7. Sender: usenet@world.std.com (Mr USENET himself)
  8. Nntp-Posting-Host: ussr.std.com
  9. Organization: The World
  10. References: <1992Sep10.011122.23106@bellahs.com>
  11. Date: Fri, 11 Sep 1992 02:55:13 GMT
  12. Lines: 18
  13.  
  14.  
  15. From: gfong@bellahs.com (Gary Fong RD)
  16. >  How can I programmatically determine if a given file descripter/pointer
  17. >belongs to a floppy device on a Sun 4/40?  Detecting the file is special and
  18. >raw, I can do.  But what function/macro will tell me it is a floppy device
  19. >or not?
  20.  
  21. A. Do an fstat() on the fd and then stat() all the floppy devices in
  22. /dev and see if any match.
  23.  
  24. B. Do an ioctl(fd,DKIOCINFO,xyz) and see if it's a floppy (see 'man dkio').
  25.  
  26.  
  27. --
  28.         -Barry Shein
  29.  
  30. Software Tool & Die    | bzs@world.std.com          | uunet!world!bzs
  31. Purveyors to the Trade | Voice: 617-739-0202        | Login: 617-739-WRLD
  32.