Remove - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


FileTools

  

Remove

  

remove a file from the file system

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Remove(file, file2, ..., opts)

Parameters

file1, file2, ...

-

one or more filenames or descriptors

opts

-

(optional) options as described below

Options

• 

force=one of true or false

  

The optional argument force controls Remove's behavior when the named file does not exist. If force=false then an error is raised. This is the default behavior. If force=true then no error is raised.

Description

• 

The Remove(file1, file2, ...) command deletes files from the file system.

• 

The Remove function does not return anything.

• 

If file refers to an open file, it is automatically closed and then deleted.

• 

Errors that occur while removing individual files are tagged, and Remove continues until it reaches the end of the list, then throws an error reporting all files that it was unable to remove.

Examples

FileTools:-Text:-WriteFiletestfile,this is a test

15

(1)

FileTools:-Text:-ReadFiletestfile

this is a test

(2)

FileTools:-Removetestfile

The file "testfile" cannot be read because it has been removed.

FileTools:-Text:-ReadFiletestfile

 Error, (in FileTools:-Text:-ReadFile) file or directory does not exist: testfile

Compatibility

• 

The FileTools[Remove] command was updated in Maple 2023.

• 

The force option was updated in Maple 2023.

See Also

file_types

FileTools

FileTools[Binary][Close]

FileTools[Binary][Open]

FileTools[Text][Close]

FileTools[Text][Open]

FileTools[Text][ReadLine]

FileTools[Text][WriteLine]

fremove

IO_errors