[Info-vax] Request description of UFS for VMS person
Bob Harris
nospam.News.Bob at remove.Smith-Harris.us
Thu Apr 23 21:42:11 EDT 2009
In article <003954a3$0$14668$c3e8da3 at news.astraweb.com>,
JF Mezei <jfmezei.spamnot at vaxination.ca> wrote:
> Bob Eager wrote:
>
> > It isn't the C RTL in my case because I used the open() system call,
> > rather than fopen(), specifically to exclude that. The check is either
> > in the kernel (most likely) or in the glue code for open() (highly
> > unlikely).
>
> You need to use SYS$OPEN and then SYS$READ :-) :-) :-)
>
> DOes Unix have the equivalent of SET FILE <mumble> /NODIRECTORY to
> convert a directory file into a normal file ?
In general no (I write Unix file system code for a living; Tru64,
HP-UX, Linux, so far). There may be a Unix implementation that
has a vendor specific ioctl() that allows something like that, but
it is not something specified by POSIX nor X/Open.
Officially you are suppose to use calls such as getdirentries(2)
and readdir(3) to access the contents of a directory. Opening a
directory is not a problem (actually it needs to be opened to use
either of the above calls), however, using read() is "undefined"
in POSIX and X/Open, where "undefined" means the file system
implementation is free to do what it wants.
These calls were created partially because some Operating Systems
(such as OpenVMS) needed a libc way to access directories without
the application code having to know the actual format of the
directory. And because different Unix file systems and/or
different Unix implementations started creating different
directory formats. Eventually Unix file systems moved beyond flat
directories and starting using fast lookup technologies. For
example Tru64 Unix AdvFS used a form of b-trees.
Bob Harris
More information about the Info-vax
mailing list