At 19:06 -0700 on 5/4/05, David M. Cotter wrote:
You can use opendev() to open the character device, that is, "/dev/rdisk2"
so, opendev() gives you the char device, while open() gives you the block device? I was unsuccessful doing
open("disk2"), I *was* successful doing open("rdisk2"). Are you saying it's better to call opendev("rdisk2")?
what exactly does prepending "r" in front of the "disk2" do?
The rdisk2 is a raw dev node. It provides block level passthrough to the underlying device- in other words, all I/O is handled directly with no caching. If you read the same block 5 times in a row, you will get 5 reads in a row on the bus. The only restriction is that all I/O must be block aligned, so be sure you know the block size of your media before using it (their are a variety of API's you can use to get the block size).
My recommendation is to simply avoid the char dev node (i.e. disk2) whenever possible- if you need block level access you generally don't need caching, and because the filesystem opens the char dev node, their is always the potential for weird things to happen.
correct, i just want to rip the stuff off and be done with it. i'm not going to read it more than once.
and my apologies to anyone on the list who saw "anyone gotn'y clue here" as something like "this list is clueless",
totally honestly and humbly, i state for the record I was feeling that *I* was the utterly clueless one, just hoping
for Obi-Wan Kenobi to save me.
Use the raw dev node young padawan. The ways of the char dev node are dark and mysterious, for the system does own it and shall block your path at every turn. Verily I say, the raw dev node is the path of light and shall not fail you when all is dark....
--
__________________________________________
Software Engineer, Intech Software Corporation
www.intechUSA.com
__________________________________________