FS_ChangeDirectory

function

Library: File system utilities (OMFSYS legacy)
Include: omfsys.xin

Declaration
define external function FS_ChangeDirectory
                value      stream  newpath
   status       modifiable stream  statusvalue

Argument definitions

newpath
is the absolute or relative path name of the new directory (input argument)
statusvalue
is an argument containing either a zero length string if the function succeeds, or one of the error codes listed in the Usage Notes section.


Purpose

The omfsys library has been deprecated and will be removed from a future version of the language. Use omvfs instead.

Use FS_ChangeDirectory to set the current (working) directory.

Requirements

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

  include "omfsys.xin"

Usage Notes

Note that "newpath" must refer to a valid path name, and you must have execute (search) access to the specified directory.

The statusvalue string sink argument will contain either a zero length string if the function succeeds, or one of the following error codes:

Example

This example sets the working directory to "C:\temp"" and outputs an error message if any error occurs.

  ; FS_ChangeDirectory
  include "omfsys.xin"
  
  process
  
     local stream error
     local stream location initial {"C:\temp"}
  
     FS_ChangeDirectory location status error
     output "Error " || error || " changing to directory "
        || location || "%n" unless error = ""

Related Topics