vfsDeleteFile

function

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

Declaration
define external function vfsDeleteFile
 value stream path
 
or
 
define external function vfsDeleteFile
 value stream filename-URL
 on value vfsDir dir

Argument definitions

path
is the path for the file to be deleted expressed in local file system format.
filename-URL
is the name of the file to be deleted expressed as a relative URL using the specified vfsDir object as its base.
dir
is a vfsDir object created using either vfsConnect or vfsConnectDir.


Purpose

Use vfsDeleteFile to remove an existing file from the virtual file system.

Requirements

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

 include "omvfs.xin"

path must:

  • exist (else external exception VFS306)
  • be expressed in local file system format either
    • relative to the current working directory on the local file system, or
    • as an absolute path

filename-URL must:

  • exist (else external exception VFS306)
  • be expressed as a relative URL based on the current working directory for dir (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)

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. (See Internet Standards RFC 1738: Uniform Resource Locators for details on valid encoding.)

External exception VFS004 is thrown if the URL exceeds system length limits.

For complete details on relative URLs, see Internet Standards RFC 1808: Relative Uniform Resource Locators.

Example

Deleting a file from the current directory

 include "omvfs.xin"
 
 
 process
 vfsDeleteFile "myfile.txt" 

Other Library Functions

AltStyle によって変換されたページ (->オリジナル) /