swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
function  

vfs.directory-name

 
 

Library: File system utilities (OMVFS)
Import: omvfs.xmd
Return type: String

Returns: The function returns the current directory for the specified VFS directory object or the local file system.


Declaration

export external stream function directory-name
        on      value directory on-dir optional

Argument definitions

on-dir
A connected vfs.directory object.


Purpose

You can use vfs.directory name to return the current working directory:

The following program saves the current working directory, changes directories, performs an operation, and restores the current working directory:

  import "omvfs.xmd" prefixed by vfs.
  
  process
     local stream cwd initial {vfs.directory-name}
     local stream listing variable
     vfs.change-directory "c:\foo\bar"
     vfs.list into listing
     repeat over listing
        output listing || "%n"
     again
     vfs.change-directory cwd

If you specify a vfs.directory, then the function returns the name of the directory represented by the vfs.directory object. The directory name is returned in URL format.

  import "omvfs.xmd" prefixed by vfs.
  
  process
     local stream listing variable
     local vfs.directory dir
     set dir to vfs.connect-directory "file:/c:/foo/bar"
     output vfs.directory-name on dir || "%n"
     vfs.change-directory ".." on dir
     output vfs.directory-name on dir

Exceptions

The following exceptions may occur:

    Related Topics
 
Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.