Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!hplabs!ucbvax!YALE.ARPA!LEICHTER-JERRY From: LEICHTER-JERRY@YALE.ARPA Newsgroups: mod.computers.vax Subject: Re: how to distinguish/create directory files with RMS ?? Message-ID: <8606131214.AA29918@ucbvax.Berkeley.EDU> Date: Fri, 13-Jun-86 08:15:31 EDT Article-I.D.: ucbvax.8606131214.AA29918 Posted: Fri Jun 13 08:15:31 1986 Date-Received: Sat, 14-Jun-86 15:55:31 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Organization: The ARPA Internet Lines: 23 Approved: info-vax@sri-kl.arpa [The author is interested in determining whether a file is a directory, and in creating directory without using LIB$CREATE_DIR.] The "file is a directory" bit is in the UCHAR word of the file header; it is accessible via an ACP QIO using the ATR$C_UCHAR attribute - see the first chapter of the I/O User's Guide, Part I (section 1.3.5 in the VMS V4.2 doc set). If RMS were to make this information available anywhere, it would be in the file header characteristics XAB (XABFHC); however, it's not listed. (There's a lot of other low-level crud that is available through the ACP interface, but which RMS doesn't pass through - which is perhaps just as well; Lord knows, RMS is complex enough as it is!) Unfortunately, you can't do ACP (or any) QIO's to a file that RMS has opened for you unless you requested UFO - User File Open - mode, in which case you can't do any RMS operations. So even testing the bit on a file already opened by RMS is painful. Even if you COULD just turn on the "file is a directory" bit, you really wouldn't want to: Directories have to be correctly formated, and the format of directory contents - in fact, even the format of an empty direc- tory - are undocumented. LIB$CREATE_DIR is the ONLY way to go, if you expect your program to work at reliably. -- Jerry -------