Delete a file: Difference between revisions
m
→{{header|Wren}}: Changed to Wren S/H
mNo edit summary |
m (→{{header|Wren}}: Changed to Wren S/H) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 478:
=={{header|COBOL}}==
To delete files or directories in COBOL we need to use unofficial extensions. The following are built-in subroutines originally created as part of some of the COBOL products created by Micro Focus.▼
{{works with|Visual COBOL}}
{{works with|
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
PROGRAM-ID. Delete-Files.
PROCEDURE DIVISION.▼
CALL "CBL_DELETE_FILE" USING "input.txt"▼
CALL "CBL_DELETE_DIR" USING "docs"▼
CALL "CBL_DELETE_FILE" USING "/input.txt"▼
CALL "CBL_DELETE_DIR" USING "/docs"▼
GOBACK▼
.</syntaxhighlight>▼
▲Alternate method of deleting files using the <code>DELETE FILE</code> statement.
{{works with|Visual COBOL}}▼
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.▼
PROGRAM-ID. Delete-Files-2.▼
ENVIRONMENT DIVISION.
Line 508 ⟶ 494:
FD Local-File.
01 Local-Record PIC X.
FD Root-File.
01 Root-Record PIC X.
Line 515 ⟶ 500:
DELETE FILE Local-File
DELETE FILE Root-File
▲ GOBACK.
▲
▲{{works with|Visual COBOL}}
{{works with|GnuCOBOL}}
▲<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION.
▲ PROCEDURE DIVISION.
▲ CALL "CBL_DELETE_FILE" USING "input.txt"
▲ CALL "CBL_DELETE_DIR" USING "docs"
▲ CALL "CBL_DELETE_FILE" USING "/input.txt"
▲ CALL "CBL_DELETE_DIR" USING "/docs"
GOBACK.▼
▲ GOBACK
▲ .</syntaxhighlight>
=={{header|Common Lisp}}==
Line 1,039 ⟶ 1,040:
<syntaxhighlight lang="lang">
# Load the IO module
# Replace "<pathToIO.lm>" with the location where the io.lm
ln.loadModule(<pathToIO.lm>)
Line 1,840 ⟶ 1,841:
Wren does not currently support the removal of directories.
<syntaxhighlight lang="
File.delete("input.txt")
|