Declaration define external function vfsDeleteDir
value stream directory-path
contents value switch contents (optional)
or
define external function vfsDeleteDir
value stream directory-URL
on value vfsDir dir
contents value switch contents (optional)
Argument definitions
- directory-path
- is the directory to delete specified in local file system format.
- directory-URL
- is the directory to be deleted.
This parameter must be a relative URL using the File scheme and with the specified vfsDir object as its base.
- dir
- is a vfsDir object created by connecting to a directory using either vfsConnect or vfsConnectDir.
- contents
- is an optional switch indicating if the directory contents are also to be deleted. The default is that directory contents are not to be deleted (VFS-NOT-INCLUDED).
Purpose
Use vfsDeleteDir to remove an existing directory.
Requirements
You must include the following line at the beginning of your OmniMark program:
include "omvfs.xin"
directory-path must:
- exist and be a directory (else external exception VFS301)
- be expressed in local file system format as either
- an absolute directory path, or
- a path relative to the current working directory for the local file system
directory-URL must:
- exist and be a directory (else external exception VFS301)
- be expressed as a relative URL based on the current working directory fordir (else external exception VFS105)
The vfsDir object 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)
If contents is supplied it must be either:
- VFS-NOT-INCLUDED - only the directory is to be removed. The directory must be empty (else external exception VFS305)
- VFS-INCLUDED - remove the directory and all of its contents (files and subdirectories)
If contents is not supplied, the function operates as if the value for contents is VFS-NOT-INCLUDED.
Usage Notes
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
Removing a directory and all its contents from the local file system.
include "omvfs.xin"
process
vfsDeleteDir "/Program Files/Games/oldVersions"
contents VFS-INCLUDED
OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.
Copyright © Stilo International plc, 1988-2010.