[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pseudocode for open.c
Ethan,
Here's basically a summary of what I plan to do w/ open.c. most of
this stuff is
essentially paraphrasing what you have already told me. so please bear w/
me.
if(node) nodespec=2;
if(file) filespec=4;
spec=nodespec+filespec;
if(spec == 2)
{
/* only the node is specified */
/* call rawio_driver to open it */
}
else if(spec == 4)
{
/* only file path is specified */
/* determine if path is absolute or not */
/* ???? call fs_driver->open(ofpath) ???*/
}
else if(spec == 6)
{
/* both device and file path are given */
/* verify fs driver */
/* ???? call fs_driver->open(ofpath) ???*/
}
when spec=6,
we check for the correct fs_driver
[1] Have you decided on how we are going to do this?
- will it involve basically calling open again w/ only the
device node specified?
[2] After verification, open needs to call fs_driver->open() correct?
which in turn calls open again to open the device node
are you comfortable w/ the __fd.h definition or do you think changes need to
be made?
when only the file path is given, I am assuming that a default device is
already going to be set (and open).
I guess there is going to be an "active directory" as well (set by the
client using chdir() or something like that)
or the file will be checked relative to the last directory
that's it for now.
thanks,
ajay