open - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Manipulation : open

open

opens a file for unbuffered reading or writing

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

open(name, mode)

Parameters

name

-

name of the file to be opened

mode

-

one of READ or WRITE

Description

• 

The open function opens the file with the specified name for unbuffered reading or writing (as specified by mode) and returns a file descriptor (a small integer).

• 

RAW file I/O is always done with a file type of BINARY.

• 

The special file names 'default' and 'terminal', referring to the current and top-level input or output streams, cannot be used with open.

• 

If the file is being opened for reading and does not exist, open generates an error.

• 

If the file is being opened for writing and does not exist, it is created if possible; otherwise, open generates an error.

• 

If the file is already open, open generates an error.

• 

If the limit for the maximum number of simultaneously open files has been reached, open generates an error.

Examples

fdopentestFile,WRITE

fd:=0

(1)

fprintffd,This is a test

15

(2)

closefd

See Also

close

file_types

FileTools[Binary][Open]

FileTools[Text][Open]

fopen

IO_errors

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam