swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

vfs.list

 
 

Library: General, File system utilities (OMVFS)
Import: omvfs.xmd

Declaration

  export external function list
          matching value stream match optional initial {'*'}
          on      value directory on-dir optional
          into    modifiable stream names
          include value integer include optional initial {all-contents}

Argument definitions

matching
The path of the directory whose content is to be listed, followed by the selection criteria. The default selection criteria is '*'
on- dir
A connected vfs.directory object. If this parameter is specified, the matching parameter is evaluated relative to the vfs.directory object and must be expressed as a relative URL, followed by the selection criteria.
names
A variable stream shelf into which the list will be written.
include
A constant indicating whether the list should include files, directories, or both.


Purpose

You can use vfs.list to list the files and/or directories in a directory. The results are returned as the items in a modifiable stream shelf. The following program lists all the xml files in a directory:

    import "omvfs.xmd" prefixed by vfs.
    process
       local stream listing variable
       vfs.list "c:\foo\bar\*.xml"
        into listing
        include vfs.all-files
       repeat over listing
          output listing || "%n"
       again

To list the files in the current working directory, simply specify the selection criteria alone without the path information:

    import "omvfs.xmd" prefixed by vfs.
    process
       local stream listing variable
       vfs.list "*.xml"
        into listing
        include vfs.all-files
       repeat over listing
          output listing || "%n"
       again

The include must be one of the following values:

Exceptions

The following exceptions may occur:

Troubleshooting

The precise wildcard matching algorithm used is platform dependent, and thus a given file pattern may match a slightly different set of files on different platforms in some cases. For instance, the selection criteria "*.xml" will match a file named "foo.xmlx" on Windows but not on UNIX.

    Related Syntax
   vfs.describe
   vfs.directory
 
  Other Library Functions
   vfs.change-directory
   vfs.change-owner
   vfs.change-permissions
   vfs.close
   vfs.connect
   vfs.connect-directory
   vfs.copy
   vfs.cursor-position
   vfs.default-certificates-file
   vfs.delete-directory
   vfs.delete-file
   vfs.describe
   vfs.describe-file
   vfs.directory
   vfs.directory-name
   vfs.disconnect
   vfs.file
   vfs.file-directory
   vfs.file-name
   vfs.link
   vfs.list
   vfs.lock
   vfs.make-directory
   vfs.move
   vfs.move-cursor
   vfs.omvfs-version
   vfs.open
   vfs.open-file-system
   vfs.open-ftp
   vfs.open-http
   vfs.open-https
   vfs.reader
   vfs.set-default-certificates-file
   vfs.truncate
   vfs.unlock
   vfs.writer
 
 

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

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:46:02 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.