vfsMove
Declaration define external function vfsMove
value stream source-path
to value stream target-path
or
define external function vfsMove
value stream source-path
to value stream target-URL
in value vfsDir target-dir
or
define external function vfsMove
value stream source-URL
on value vfsDir source-dir
to value stream target-path
or
define external function vfsMove
value stream source-URL
on value vfsDir source-dir
to value stream target-URL
in value vfsDir target-dir
Argument definitions
- source-path
- is the source directory or file to be moved, expressed in local file system format.
- target-path
- is the target directory or file for the move, expressed in local file system format.
- source-URL
- is the source directory or file to be moved, expressed as a relative URL using the specified source vfsDir object as its base.
- source-dir
- is a connected vfsDir object.
- target-URL
- is the target directory or file for the move, expressed as a relative URL using the specified target vfsDir object as its base.
- target-dir
- is a vfsDir object created by connecting to a directory using either vfsConnect, or vfsConnectDir.
Purpose
Use vfsMove to move
- a file or
- a directory (including all subdirectories and files)
from the source location to a target location.
Requirements
You must include the following line at the beginning of your OmniMark program:
include "omvfs.xin"
The move source source-path must:
- exist (else external exception VFS306)
- be a file or a directory
- be expressed
- relative to the current working directory on the local file system, or
- as an absolute directory path or absolute path and file name
The move target target-path must:
- not exist or must be a directory (else external exception VFS307)
- be expressed
- relative to the current working directory on the local file system, or
- as an absolute path
The move source source-URL must:
- exist (else external exception VFS306)
- be expressed as a relative URL based on the current working directory for the specified source-dir (else external exception VFS105)
The vfsDir object source-dir must:
- represent an existing connection made using vfsConnect or vfsConnectDir (else external exception VFS100)
- represent a connection made using the file scheme (else external exception VFS001)
The move target target-URL must:
- not exist or must be a directory (else external exception VFS307)
- be a file or a directory
- be expressed as a relative URL based on the current working directory for the specified target-dir (else external exception VFS105)
The vfsDir object target-dir must:
- represent an existing connection made using vfsConnect or vfsConnectDir (else external exception VFS100)
- represent a connection made using the file scheme (else external exception VFS001)
Usage Notes
If target-path does not exist, target-path will be the name of the moved source. If target-path exists (is a directory) the source will be placed inside the directory target-path.
If target-URL does not exist, target-URL will be the name of the moved source. If target-URL exists (is a directory) the source will be placed inside the directory target-URL.
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.
Example
Moving a directory and its contents to a new location
include "omvfs.xin"
process
. . .
vfsMove "../version1"
to "/Program Files/oldversion1"