write a single character to a file - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Manipulation : FileTools : FileTools/Text/WriteCharacter

FileTools[Text][WriteCharacter] - write a single character to a file

Calling Sequence

WriteCharacter(file, char)

Parameters

file

-

file descriptor or filename

char

-

string of length 1

Description

• 

The WriteCharacter(file, char) command writes the character char to file.

• 

If file is the name of a file that has not been opened, Maple attempts to open the file before writing the character.  If the file does not exist, it is created.

• 

An error is raised if file is not a valid descriptor or it refers to a file that cannot be opened.

Examples

FileTools[Text]WriteCharactertestfile,a

1

(1)

FileTools[Text]WriteCharactertestfile,b

1

(2)

FileTools[Text]WriteCharactertestfile,c

1

(3)

FileTools[Text]Closetestfile:

FileTools[Text]ReadStringtestfile

abc

(4)

FileTools[Remove]testfile

See Also

file, FileTools[Remove], FileTools[Text], FileTools[Text][Close], FileTools[Text][Open], FileTools[Text][ReadCharacter], FileTools[Text][ReadString], 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