vfsChangeDir

function

Library: File system utilities (OMVFS legacy)
Include: omvfs.xin

Declaration
define external function vfsChangeDir
       value  stream  directory-path

or

define external function vfsChangeDir
       value  stream  directory-URL
   on  value  vfsDir  dir 
   

Argument definitions

directory-path
is the local file system directory that will become the new current working directory. This parameter must be expressed in local file system format, either relative to the current working directory or as an absolute path.
directory-URL
is the directory that will become the new current working directory for the specified vfsDir object. This parameter must be a relative URL using using the specified vfsDir object as its base.
dir
is a vfsDir object created by connecting to a directory using either vfsConnect, or vfsConnectDir.


Purpose

Use vfsChangeDir to change the current working directory

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omvfs.xin"

The location supplied for directory-path must:

The location supplied for directory-URL must:

The vfsDir object dir must:

Usage Notes

The new current working directory will be used for all subsequent vfs function calls.

General OS operation failure exceptions will return external exception VFS300. The accompanying text will contain details on the reason for the exception.

External exception VFS111 is thrown if an URL supplied as a parameter to this function contains invalid encoding.

External exception VFS004 is thrown if the URL or path exceeds system length limits.

For complete details on absolute URLs and valid encoding, see Internet Standards RFC 1738: Uniform Resource Locators.

For complete details on relative URLs, see Internet Standards RFC 1808: Relative Uniform Resource Locators.

Example #1: Using the Local File System form of vfsChangeDir

A subdirectory of the current working directory is myPrograms. Make myPrograms the new current working directory.

  include "omvfs.xin"
  
  process
    vfsChangeDir "myPrograms\" 

Example #2: Using the Network Resource form of vfsChangeDir

Connect to a local directory. Make another directory on the same drive the current working directory. Make a directory on another drive the current working directory.

  include "omvfs.xin"
  
  process
    local vfsDir Chicago
  	   . . .
    set Chicago to vfsConnect "file:///c:/ChicagoFormats/Style/"
    	   . . .
    vfsChangeDir "../Program%%20files/"
    	on Chicago
    	   . . .
    vfsChangeDir "/d:/Testing/"
    	on Chicago