Delete A File

From ArcoWiki
Jump to: navigation, search

The ability of deleting a file is achieved using a non-Dmis statement.
Since there is no user interface to add it, the code shall be type manually using the following syntax:


$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$Example 1
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
DECL/CHAR,200,filePath
filePath = ASSIGN/'D:\FileToDelete.txt'

DID(READFILE)=DEVICE/STOR,filePath
OPEN/DID(READFILE),DIRECT,OUTPUT,OVERWR
WRITE/DID(READFILE),'Test String'
CLOSE/DID(READFILE),DELETE

CALL/EXTERN,DME,'FILESYSTEM','REMOVE',CONCAT(fileName,'')

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$Example 2
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
DECL/CHAR,200,filePath
filePath = ASSIGN/'D:\FileToDelete.txt'

DID(READFILE)=DEVICE/STOR,filePath
OPEN/DID(READFILE),DIRECT,OUTPUT,OVERWR
WRITE/DID(READFILE),'Test String'
CLOSE/DID(READFILE),DELETE

CALL/EXTERN,DME,'FILE_SYSTEM','REMOVE',CONCAT(fileName)

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$Example 3
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
DECL/CHAR,200,filePath
filePath = ASSIGN/'D:\FileToDelete.txt'

DID(READFILE)=DEVICE/STOR,filePath
OPEN/DID(READFILE),DIRECT,OUTPUT,OVERWR
WRITE/DID(READFILE),'Test String'
CLOSE/DID(READFILE),DELETE

CALL/EXTERN,DME,'FILE_SYSTEM','REMOVE','D:\FileToDelete.txt'