swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
OMX  

vfs.directory

 
 

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


Purpose

The VFS directory OMX component represents a directory location. Once a connection to a directory has been established using either of these functions, that connection can be used by other vfs functions.

Usage Notes

The OmniMark Virtual File System dynamic link library file ("omvfs.dll") creates the VFS directory OMX component. The related module file ("omvfs.xmd") defines the interface to that component. To use VFS directory OMX components in your program, you must import it into your program using a statement like this:

  import "omvfs.xmd" prefixed by vfs.

Please refer to OMX Components for a general description of OMX components and how they are used.

Related OMVFS library functions:

The functions

are used to establish and discard directory connections. VFS directory objects are used by the following OMVFS library functions:

Example: Using a VFS directory object

This example shows a connection to a directory being established, and that connection being used by other vfs functions.

  import "omvfs.xmd" prefixed by vfs.
  process
    local vfs.file myFile
    local vfs.directory myDir
    local stream attributes-shelf variable
    	. . .
    set myDir to vfs.connect "file:///omprogs/"
    	. . .
    set myFile to vfs.open "jean-sibelius.txt" 
    	on myDir for vfs.read-mode 
    	. . .
    vfs.describe-file myFile into attributes-shelf
    output "    Name:   " || attributes-shelf{"name"} || "%n"
    output "    Size:   " || attributes-shelf{"size"} || " bytes%n"
    do when attributes-shelf{"isdir"} = 0
      output "    Type:   file" || "%n"
    else
      output "    Type:   directory" || "%n"
    done
    output "Contents:  " || vfs.read myFile || "%n"

This program produces the following output:

  Name:   file:///omprogs/jean-sibelius.txt
      Size:   115 bytes
      Type:   file
  Contents:  "Pay no attention to what the critics say; no statue has ever been erected to a critic."
       -- Jean Sibelius

    Related Syntax
   vfs.connect
   vfs.connect-directory
   vfs.make-directory
   vfs.delete-directory
   vfs.directory-name
 
  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 ] [ 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.