data type
| 
                
Library: File system utilities (OMVFS)
 Import : omvfs.xmd  | 
              
 The vfs.file data type represents an individual file.
      
The functions
are used to open and close files.vfs.file objects are used by the following OMVFS library functions:
        vfs.cursor-position—get the current position of the cursor in a VFS file object.
          
vfs.describe-file—return a set of attributes describing a file.
          
vfs.file-directory—get the directory location of the file.
          
vfs.file-name—get the file name of a VFS file object.
          
vfs.lock—lock an entire VFS file object or a specific area of it.
          
vfs.move-cursor—change the cursor position from the current location in a file's contents to the position you specify.
          
vfs.reader—read the contents of a VFS file and return them in an OmniMark source. 
          
vfs.truncate— truncate a file at a specified byte. 
          
vfs.unlock—unlock a single locked section or an entire file.
          
vfs.writer—obtain an output object (write) to an open file. 
        
 This example shows vfs.file being used to obtain the properties and contents of a file.
        
import "omvfs.xmd" prefixed by vfs. process local vfs.directory directory-handle local vfs.file file-handle local stream properties variable set directory-handle to vfs.connect "file:///omprogs/" set file-handle to vfs.open "jean-sibelius.txt" on directory-handle for vfs.read-mode vfs.describe-file file-handle into properties output " Name: " || properties{"name"} || "%n" output " Size: " || properties{"size"} || " bytes%n" do when properties{"isdir"} = 0 output " Type: file" || "%n" else output " Type: directory" || "%n" done output "Contents: " || vfs.reader of file-handle || "%n"
 Depending on the state and contents of the file system, this program might produce output such as:
        
  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
      
 To use the vfs.file data type in your program, you must import OMVFS into your program using an import
      declaration such as:
        
import "omvfs.xmd" prefixed by vfs.