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

FS_ListDirectory

 
 

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

Declaration

  define external function FS_ListDirectory
                  value      stream  pathname
     into         modifiable stream  directory
     status       modifiable stream  statusvalue 


Purpose

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

This function retrieves the contents list of the specified directory.

Example:

  ; fs-listdirectory.xom
  include "omfsys.xin"
   process
      local stream  current-dir variable initial-size 1 initial {"C:\omprogs"}
      local stream  dir-list variable initial-size 0
      local stream  error-status  variable initial-size 1

      FS_ListDirectory current-dir into dir-list status error-status

      repeat over dir-list
          do when file (current-dir || "/" || dir-list) is directory
              output "%_" || "<dir> "
                          || dir-list || "%n"
          else
              output "%_" || "<file>"
                          || dir-list || "%n"
          done
      again
  ; Output lists all directories "<DIR>" and files "<file>" in current-dir.

Input argument:

Output arguments:

Wildcards are allowed in the directory parameter.

For example, the following line will cause FS_ListDirectory to find all files ending in ".xom" within "C:\omprogs"

  local stream pathname initial {"C:\omprogs\*.xom"}

The following line will cause FS_ListDirectory to find all files beginning with "om" within "C:\omprogs"

  local stream pathname initial {"C:\omprogs\om*"}

Note that "pathname" must reference a valid directory path. Also, "dot" directory entries are not returned.

        Other Library Functions
   FS_ChangeDirectory
   FS_ChangeOwner
   FS_ChangePermissions
   FS_DeleteDirectory
   FS_DeleteFile
   FS_GetCurrentDirectory
   FS_IsVersionCompatible
   FS_LibraryVersion
   FS_Link
   FS_ListDirectory
   FS_MakeDirectory
   FS_Rename
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.