AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
yoixPath (String path) yoix.system
 
Converts the supplied path into a fully resolved path in Yoix format. The supplied path need not indicate an existing file or directory. Fully resolved means that all relative references and references to the current directory are resolved. Yoix format means that the slash character, /, is used to delimit path components. Multiple consecutive occurrences of slash or the platform dependent file separator character are replaced by a single slash, except that the leading two slashes are retained when path appears to represent a Microsoft UNC pathname.

The current directory is resolved to the value of the Java property user.pwd, if supplied, or user.dir, otherwise. The user.pwd property can be set by using the -D option to the Java interpreter when running Yoix. When supplied, user.pwd can refer to a symbolic link, but it must indicate the same physical location as that indicated by user.dir and must contain no relative references otherwise it will be ignored and the value of user.dir will be used in its place. The current directory is fixed when Yoix is started.

The path string may use slashes, /, to delimit path components or the platform-dependent component separator may be used. On Windows platforms, the path string can represent disk information either by the usual letter-colon format or using a slash-letter-slash format, familiar to users of Dave Korn's U/WIN, so that relative references can be used to change disks. In either event, the returned string will represent disk information using the usual letter-colon format.
 
 Example:   On a Windows platform with the current directory being c:\appl, then the following:
import yoix.system.*;
import yoix.stdio.*;

printf("%25s <==> %s\n", ".", yoixPath("."));
printf("%25s <==> %s\n", "d:\\new_appl", yoixPath("d:\\new_appl"));
printf("%25s <==> %s\n", "/d/new_appl", yoixPath("/d/new_appl"));
printf("%25s <==> %s\n",
    "../../d/new_appl", yoixPath("../../d/new_appl"));
printf("%25s <==> %s\n",
    "../other_appl/file", yoixPath("../other_appl/file"));
printf("%25s <==> %s\n",
    "//computer/folder/file", yoixPath("//computer/folder/file"));
results in:
                        . <==> c:/appl
              d:\new_appl <==> d:/new_appl
              /d/new_appl <==> d:/new_appl
         ../../d/new_appl <==> d:/new_appl
       ../other_appl/file <==> c:/other_appl/file
   //computer/folder/file <==> //computer/folder/file
 
 Return:   String
 
 See Also:   access, directoryListing, fileModified, fileSize, fopen, isDirectoryPath, isFilePath, localPath, mkdir, mkdirs, open, realPath, rename, rmdir, stat, unlink

 

Yoix is a registered trademark of AT&T Inc.