swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

vfsList

 
 

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

Declaration

define external function vfsList
   matching  value       stream   path-match optional  initial {"*"}
       into  modifiable  stream   namelist
    include  value       integer  include    optional  initial {VFS-FULL-CONTENTS}

or

define external function vfsList
   matching  value       stream   URL-match  optional  initial {"*"}
         on  value       vfsDir   dir
       into  modifiable  stream   namelist
    include  value       integer  include    optional  initial {VFS-FULL-CONTENTS}

Argument definitions

path-match
is the name matching criteria expressed in local file system format.
URL-match
is the name matching criteria expressed a relative URL using the file scheme and with the specified vfsDir object as its base.
dir
is a vfsDir object created by connecting to a directory using either vfsConnect or vfsConnectDir.
namelist
is the returned shelf of matched directory items
include
specifies the type of items to include (directories, files, or both)


Purpose

Use vfsList to list the files and/or subdirectories in a directory. The results are returned as the items in a modifiable stream shelf. This shelf is initially cleared of all contents.

Requirements

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

  include "omvfs.xin"

path-match:

If path-match is not specified, the action will be performed on the current working directory of the local file system as if a match value of "*" was used.

URL-match:

If URL-match is not specified, the action will be performed on the current working directory for the vfsDir object dir as if a match value of "*" was used.

The vfsDir object dir must:

include must be one of the following values:

If the value supplied for include is not one of these an exception will be thrown (external exception VFS109). If include is not supplied, the action will be performed as if an include value of VFS-FULL-CONTENTS was used.

Usage Notes

An item is added to the names shelf for every directory and/or file that meets

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

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.

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

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.

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

Example: Listing all the files and directories in the current directory

This program will collect a list of all items in the current working directory, check the last modified date, and output a list of everything that has been modified since 8:00am EST, October 31, 2000

    include "omvfs.xin"
    include "omdate.xin"
    process
       local stream listing variable
  	. . .
       vfsList
       	into listing
       	include VFS-FULL-CONTENTS
       repeat over listing
          local stream attrs variable
          vfsDescribe listing
             into attrs
          output listing || "%n" when ymdhms-second-difference ( attrs{"mtime"},
             "20001131080000-0500" ) > 0
       again

        Other Library Functions
   vfsChangeDir
   vfsChangeOwner
   vfsChangePermissions
   vfsClose
   vfsConnect
   vfsConnectDir
   vfsCopy
   vfsCursorPosition
   vfsDeleteDir
   vfsDeleteFile
   vfsDescribe
   vfsDescribeFile
   vfsDir
   vfsDirName
   vfsDisconnect
   vfsFile
   vfsFileDir
   vfsFileName
   vfsIsVersionCompatible
   vfsLibraryVersion
   vfsLink
   vfsList
   vfsLock
   vfsMakeDir
   vfsMove
   vfsMoveCursor
   vfsOpen
   vfsRead
   vfsRename
   vfsTruncate
   vfsUnlock
   vfsWrite
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.