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

define external function vfsDescribe
       value       stream  path
  into modifiable  stream  attributes


define external function vfsDescribe
       value       stream  filename-URL
    on value       vfsDir  dir
  into modifiable  stream  attributes

Argument definitions

is the file to describe expressed in local file system format.
is the name of the file to describe expressed as a relative URL using the specified vfsDir object as its base.
is a vfsDir object created using either vfsConnect or vfsConnectDir.
is the returned shelf of description items.


Use vfsDescribe to obtain a description of a file or a directory.


You must include the following line at the beginning of your OmniMark program:

  include "omvfs.xin"

path must:

filename-URL must:

The vfsDir object dir must:

Usage Notes

The attributes shelf returned by this function contains the following keyed items.

  1. "name" (fully qualified file or directory name)
  2. "size" (file size in bytes)
  3. "atime"" (last accessed time in OmniMark date format)
  4. "mtime" (last modified time in OmniMark date format)
  5. "ctime" (last status change time in OmniMark date format)
  6. "isdir" (is this a directory or a file?)
  7. "permissions" (integer representation of file/dir permissions)
  8. "owner" (username of owner)
  9. "group" (group of file/dir)

If the drive containing the file or directory being described is a read-only drive (for example, a CD-ROM), the atime may be zero.

The attributes shelf is initially cleared of all contents.

If a particular attribute item is not supported by a virtual file system protocol , it is returned as an empty string.

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.


Obtaining the size of a file

  include "omvfs.xin"
    local stream attrs variable
    vfsDescribe "/programs/myscript.xom"
    	into attrs
    output attrs {"size"} || "%n"