write_n_chars

write_n_chars — writes characters from a buffer to a file.

Syntax

write_n_chars (file, buffer, nchars)

		

Arguments

file

A file pointer to the open destination file for the characters.

buffer

The buffer that is the source of the characters.

nchars

The number of characters to write.

Returns

The number of characters successfully written to the file.

Description

This function reads a given number of characters from a buffer and writes them to an open file.

Example

The following example writes the characters 'e', 'f', and 'g' to a file.

Gamma> fw = open("mywritencharsfile.dat", "w");
#<File:"mywritencharsfile.dat">
Gamma> buf = buffer (101, 102, 103, 104);
#{efgh}
Gamma> write_n_chars (fw, buf, 3);
3
Gamma>  
		

See Also

write, writec, pretty_write