swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

vfs.connect

 
 

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

Returns: A vfs.directory object for the specified directory.


Declaration

export external directory function connect
                value string location
        on      value directory on-dir optional

Argument definitions

location
The location of the directory you wish to connect to in URL format using the file scheme.
on-dir
A connected vfs.directory object. If a vfs.directory is specified, the location parameter must be a relative URL which will be evaluated relative to the specified vfs.directory object.


Purpose

You can use vfs.connect to create a connection to a directory. The connection will be represented by a vfs.directory object. While it is usable now, this functionality is intended chiefly for use in a future version of OMVFS that will support a variety of network protocols such as HTTP and FTP. These protocols require a vfs.directory object to retain state information. This is not required with the local file system.

vfs.connect is a general form of the connect functionality that determines the type of connection to make based on the protocol specified in the URL used to specify the resource to connect to. vfs.connect-directory is a specific form of this functionality intended for use with the local file system.

All functions in the OMVFS library that take directory information (or that assume the current working directory) can also take anvfs.directory object via the on-dir parameter (heralded by on). As a general rule, you should specify locations using file system paths when working with the current working directory, and URLs when working with vfs.directory objects. (In practice some crossover between the two forms is allowed, but this facility should be used with care to ensure consistency.)

The following program creates a connection to a directory. The connection is represented by a vfs.directory object:

  import "omvfs.xmd" prefixed by vfs.
  
  process
    local vfs.directory Chicago
       .
    set Chicago to vfs.connect "file:///myPrograms/"

The following program creates a connection relative to an existing vfs.directory object:

  import "omvfs.xmd" prefixed by vfs.
  
  process
    local vfs.directory Toronto
    local vfs.directory Montreal
    . . .
    set Montreal to vfs.connect "file:///Olympics/History_In_Canada/"
    . . .
    set Toronto to vfs.connect "../Facilities/"
    on Montreal

Exceptions

The following exceptions may occur:

    Related Syntax
   vfs.connect-directory
   vfs.disconnect
   vfs.make-directory
   vfs.delete-directory
   vfs.change-directory
   vfs.directory
 
  Other Library Functions
   vfs.change-directory
   vfs.change-owner
   vfs.change-permissions
   vfs.close
   vfs.connect
   vfs.connect-directory
   vfs.copy
   vfs.cursor-position
   vfs.default-certificates-file
   vfs.delete-directory
   vfs.delete-file
   vfs.describe
   vfs.describe-file
   vfs.directory
   vfs.directory-name
   vfs.disconnect
   vfs.file
   vfs.file-directory
   vfs.file-name
   vfs.link
   vfs.list
   vfs.lock
   vfs.make-directory
   vfs.move
   vfs.move-cursor
   vfs.omvfs-version
   vfs.open
   vfs.open-file-system
   vfs.open-ftp
   vfs.open-http
   vfs.open-https
   vfs.reader
   vfs.set-default-certificates-file
   vfs.truncate
   vfs.unlock
   vfs.writer
 
 

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.