ScriptBasic:UsersGuide 12.11

From ScriptBasic
Jump to: navigation, search

[Contents]

12. File Handling

12.11. Deleting a file or directory

[<<<] [>>>]


Using the command truncate you can truncate a file to size zero, but the empty file is still there. To totally delete a file you have to use the command DELETE. The syntax of the command is

delete expression

where the expression is the name of the file or directory to be deleted. When issuing this command to delete a directory the directory should be empty otherwise the command fails and an error occurs. There is another command with the syntax


deltree expression

that deletes a directory even if the directory is not empty. Note that this command is very dangerous, because it forcefully deletes full directory trees and therefore you have to use this format of the command with exceptional great care.


[<<<] [>>>]