vfs.reader

function

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

Returns: An OmniMark source object to the opened file


Declaration
export external string source function reader
        of      value file file-ref

	

Argument definitions

file-ref
The vfs.file object associated with the file to be read from.


Purpose

You can use vfs.reader to read the contents of a file opened with vfs.open. vfs.reader returns an OmniMark source attached to the specified file.

  import "omvfs.xmd" prefixed by vfs.
  
  process
    local vfs.file test-file
     set test-file to vfs.open "/programs/test.txt" 
      for vfs.read-mode
    submit vfs.reader of test-file

You can also read a file using OmniMark's built in file keyword, but using vfs.file gives you greater control over how the file is opened and read.

Exceptions

The following exceptions may occur: