Concept Framework 1.0 documentation Contents | Index

standard.C.io.fputs

Name Version Deprecated
fputs version 1.0 no

Prototype:
number fputs(string buffer, number fd)

Parameters:
buffer      [in] Output string
fd      [in] A valid file descriptor

Description:
fputs copies buffer to the output stream fd at the current position, without the terminating null character.

Example:
import standard.C.io


define FILENAME "test.txt"

class Main {
function Main() {
var fd;
var buffer = "Testing fputs.";

// Open file for write
if (fd = fopen(FILENAME, "w")) {
if (fputs(buffer, fd))
echo "fputs error\n";
else
echo "fputs success\n";
fclose(fd);
} else
echo "Problem opening the file\n";

}
}

Results
fputs success

Returns:
fputs returns a negative value if it is successful.

Documented by Simona Plesuvu, generation time: Thu Oct 15 20:02:04 2009 GMT(c)2009 RadGs Software