next up previous index
Next: Z300 IBM-Dependent Input/Output Up: CERNLIB Previous: Z266 Get the

Z267 Convert File-name to and from UNIX Syntax

Routine ID: Z267
Author(s): J. ZollLibrary: KERNLIB, VAX only
Submitter: Submitted: 01.09.1990
Language: FortranRevised: 01.11.1994

These routines convert a file name from UNIX form to VAX VMS form, and vice versa. The correspondance is as follows:

   VAX:    node::disk:[a.b.c]file.ext;cy
   UNIX:   //node/disk/a/b/c/file.ext;cy
 
   VAX:     [a.b.c]file.ext;cy   and   [.a.b.c]file.ext;cy
   UNIX:   /(a/b/c/file.ext;cy           a/b/c/file.ext;cy
Forms like ../file.ext;cy and /dir/file.ext;cy are also handled.
For back-compatibility /=disk is handled as /disk.

Structure:

SUBROUTINE subprograms
User Entry Names: FTOVAX, FFRVAX
Common Blocks: COMMON /SLATE/ ISTAT,DUMMY(39)

Usage:

Convert to VAX form

    CALL FTOVAX(CHNAME,NCH)
 
       *CHNAME*  file-name to be converted in situ
          *NCH*  significant length of the name

No conversion is done if the file-name does not contain a character "/" on input.
Convert to UNIX form

    CALL FFRVAX(CHNAME,NCH)
 
       *CHNAME*  file-name to be converted in situ
          *NCH*  significant length of the name
No conversion is done if the file-name does already contain a character "/" on input.

This routine does some tidying up if necessary, thus for example the troublesome disk:[a][b.c]fn.ext becomes the correct /disk/a/b/c/fn.ext

Both routines return ISTAT=0 if no conversion was needed, ISTAT=1 for successful conversion,
and ISTAT=-1 if a syntax error was detected.

Note that both routines update both the file-name and its useful length NCH in situ.

Examples:

   tex/z267.tex                   [.tex]z267.tex
   ../wyl/kernfor.car             [-.wyl]kernfor.car
   /(julia/kern/wyl/kernvax.car   [julia.kern.wyl]kernvax.car
   /cern_root/pam/kernfor.car     cern_root:[pam]kernfor.car

Z300


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995