function
Library: File system utilities (OMVFS legacy)
Include: omvfs.xin |
Returns: a vfsFile object for the opened file |
define external vfsFile function vfsOpen value stream file-path for value integer access-type optional or define external vfsFile function vfsOpen value stream absolute-URL for value integer access-type optional or define external vfsFile function vfsOpen value stream relative-URL on value vfsDir dir for value integer access-type optional
Argument definitions
Use vfsOpen to open a file. A vfsFile OMX component is returned.
You must include the following line at the beginning of your OmniMark program:
include "omvfs.xin"
file-path must be expressed in local file system format, either as an absolute path, or relative to the current working directory.
absolute-URL must be expressed as an absolute URL.
relative-URL must be expressed as a relative URL based on the current working directory for the vfsDir object dir (else external exception VFS105).
The vfsDir object dir must:
access-type is an optional parameter which defaults to VFS-READ. If it is supplied, it must have one of the following values:
If the access-type is VFS-READ, the file must exist (else external exception VFS306).
If an existing file is opened with an access-type of VFS-WRITE, then its contents are deleted.
External exception VFS300 is thrown for any general OS operation failure. The text accompanying the exception will contain details on the reason for the failure.
External exception VFS111 is thrown if an URL supplied as a parameter to this function contains invalid encoding.
External exception VFS004 is thrown if the URL exceeds system length limits.
For complete details on absolute URLs and valid encoding, see Internet Standards RFC 1738: Uniform Resource Locators.
For complete details on relative URLs, see Internet Standards RFC 1808: Relative Uniform Resource Locators.
Opening a file in a subdirectory of the current directory with read-only access.
include "omvfs.xin" process local vfsFile myFile . . . set myFile to vfsOpen "programs/myscript.xom" for VFS-READ