WriteCharacter - Maple Help

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

 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{WriteCharacter}\right]\left("testfile","a"\right)$
 ${1}$ (1)
 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{WriteCharacter}\right]\left("testfile","b"\right)$
 ${1}$ (2)
 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{WriteCharacter}\right]\left("testfile","c"\right)$
 ${1}$ (3)
 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{Close}\right]\left("testfile"\right):$
 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{ReadString}\right]\left("testfile"\right)$
 ${"abc"}$ (4)
 > $\mathrm{FileTools}\left[\mathrm{Remove}\right]\left("testfile"\right)$