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

vfsFile

 
 

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


Purpose

The vfsFile OMX component represents an individual file.

Usage Notes

The OmniMark Virtual File System dynamic link library file ("omvfs.dll") creates the vfsFile OMX component. The related include file ("omvfs.xin") defines the interface to that component. To use vfsFile OMX components in your program, you must include the following include statement in your program:

     include "omvfs.xin"

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 open and close files. vfsFile objects are used by the following OMVFS library functions:

Example: Opening a file


  include "omvfs.xin"
  process
    local vfsFile myFile
    local vfsDir myDir
    local stream attributes-shelf variable
    set myDir to vfsConnect "file:///omprogs/"
    set myFile to vfsOpen "jean-sibelius.txt" on myDir for vfs-read 
    vfsDescribeFile 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:  " || vfsRead 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

        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.