oking@smiley.arpa (Osborne I King) (07/26/90)
How do I read inode information associated with a special file for example: a block special file. thanks, Oz......
jik@athena.mit.edu (Jonathan I. Kamens) (07/27/90)
(Note the Followup-To and cross-post on this; I don't really think it's a wizard-level question.) In article <114837@linus.mitre.org>, oking@smiley.arpa (Osborne I King) writes: |> How do I read inode information associated with |> a special file for example: a block special file. Your subject line says, "How do I read an inode?" and your message says, "How do I read inode information associated with a special file..." but I'm still not sure what you're asking. What "inode information" are you asking about? Since you mention special files in particular, my best guess is that you're talking about the major and minor device numbers and the device type. To obtain both of these, you use the stat() system call, the same way you would to obtain file information about any regular file. In particular, the st_mode field of the stat structure tells you whether it's a character or block special device (S_IFCHR and S_IFBLK on BSD, I don't know what it is on others), and the st_rdev field tells you the major and minor device numbers (the first two bytes are the major number, and the second two bytes are the minor number). If that isn't what you're talking about, please explain a little bit more clearly what you *are* talking about, so we can help you :-). Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710
bob@wyse.wyse.com (Bob McGowen x4312 dept208) (07/27/90)
In article <114837@linus.mitre.org> oking@smiley.arpa (Osborne I King) writes: >How do I read inode info ...... .... check out the stat(2) man entry. Bob McGowan (standard disclaimer, these are my own ...) Product Support, Wyse Technology, San Jose, CA ..!uunet!wyse!bob bob@wyse.com