1 NFSNAME The NFSNAME utility takes a general Unix filename specification and converts it to a VAX/VMS file specification, applying the rules for character translation used by TGV Multinet-NFS v3.0. These rules are spelled out in detail in Section 4.3 of the NFS Client Users Guide. Format: NFSNAME unix_filespec [VMS_symbol] 2 Parameters unix_filespec A string of up to 255 characters containing a valid Unix file specification. The specification need not be a real file on a mounted Unix disk, and may include a relative directory specification. The last part of the filespec is assumed to be a file name, not a directory name. There is no checking for file existence. If the Unix file specifcation contains any lower case characters, it must be enclosed in quotation marks (" ") as a command line argument. VMS-symbol (optional) The name of a local VMS symbol into which the converted VAX/VMS file specification will be written. If no symbol name is given, the filespec will be written to SYS$OUTPUT. 2 Return_value If unix_filespec includes a rooted directory specification (e.g., /users/smith/data), the root directory is compared to the volume names of all mounted NFS disks. If a match is found, the NFS device specification is included in the VAX/VMS file specification. If no match for a rooted directory is found, a VMS rooted directory specification is returned with no device. If only a relative directory specification is provided, then a VMS directory specification with no device will always be returned. See EXAMPLES for more information. 2 Algorithm The Unix/VMS filename conversion algorithm is described in detail, with a table of character conversions, in both the NFS Server and NFS Client Users Guides provided with TGV Multinet. 1) '$' is the escape character. It is used to mark the beginning of special character sequences. 2) If a '$' appears in the Unix filespec, it is replaced with '$$'. 3) Lower case letters in the Unix filespec are replaced with upper case. 4) A change between lower case and upper case is marked with a '$'. 5) In the Unix filespec, the first '.' maps to the VMS filename/type delimiter '.'. All succeeding '.' chararacters in the Unix filespec are converted to the character escape code '$5N'. 6) In a directory name, all '.' characters in the Unix name are converted to the escape code '$5N'. 7) The Unix special directories '.' and '..' are converted to the null string and the special VMS directory '-' respectively. 8) The Unix directory delimiter '/' is converted to the VMS directory delimiter '.'. 9) Special characters which do not appear in the VAX/VMS character set are converted to '$nx' escape codes, where n is a digit between 4 and 9, and x is an arbitrarily assigned character. See the TGV Multinet NFS manuals for the complete list. 10) Eight bit characters (ASCII code > 127) in the Unix filespec are converted to escape codes '$nnn' where nnn is the octal representation of the ASCII code. 11) If the Unix filename contains no '.' delimiters, and the resulting VMS filename is more than 39 characters long, '$.' is inserted after the 38th character of the VMS filename. 2 Examples Assume that the Unix disk '/usr' has been NFS-mounted as device NFS2:. $ NFSNAME "/usr/smith/Data.DIR/testFile.run255~" VMSFILE $ SHOW SYM VMSFILE VMSFILE = "NFS002:[SMITH.$D$ATA$5N$DIR]TEST$F$ILE.RUN255$9E" The user has provided a full (rooted) Unix file specification, with a root directory that has been mounted on the VAX/VMS system via NFS. The user has also provided the name of a VMS symbol to hold the converted filespec. $ NFSNAME "bin/myprog" [.BIN]MYPROG Here the user provided a relative directory specification, and requested that the converted filename be written to the terminal (SYS$OUTPUT). Notice that this Unix string contained no special characters, so it was converted directly to upper case. $ NFSNAME "/jones/source/TauXSec.c" [JONES.SOURCE]$T$AU$XS$EC.C Here the user provided a rooted directory, but one which has not been mounted via NFS. With no device available, a rooted VAX/VMS directory string is returned. 2 Installation_Notes NFSNAME is a self-contained program, which does not require Multinet or other third-party software. It does require VMS 5.0 or later, and the VAX/VMS Fortran complier and run-time library. NFSNAME is distributed as a BACKUP save-set, NFSNAME.BCK, which contains the source and include files for the program, an installation command procedure, and this help file. Users should restore the save-set to a subdirectory and run @MAKE_NFSNAME to produce the command executable, a link library containing Fortran-callable subroutine, and a help library. A system logical name, NFSNAME_DIR, should be defined (/SYS/EXEC) to point to the directory to which the software was installed. System managers must define a foreign command in SYLOGIN.COM in order for users to access the NFSNAME command: $ NFSNAME :== $NFSNAME_DIR:NFSNAME System managers should also add NFSNAME_DIR:NFSNAME.HLB to the list of installed help libraries, by modifying SYSTARTUP_V5.COM (or a local command procedure invoked from it $ DEFINE/SYS/EXEC HLP$LIBRARY_n NFSNAME_DIR:NFSNAME.HLB where "_n" may be left off if no other local help libraries are installed, and n=(1,2,3,...) specifies additional local help libraries. 3 Copyright Copyright (c) 1993 Trustees of the California Institute of Technology This product is provided on an as-is basis, and no warranty is made for merchantibility, fitness of use, or suitability for a particular purpose. This product may be copied, modified, and distributed freely provided that (a) no cliams for product use are made, and (b) that copyright notices contained in in any parts of this product are retained unaltered. 3 Support NFSNAME was written by Michael H. Kelsey, currently (1993) a graduate student at the California Institute of Technology. E-mail support for this product is available from kelsey@cithex.caltech.edu (Internet), CITHEX::KELSEY (DECnet), and KELSEY@CITHEX (BITNET).