Admin Production ni-theme
Current Publication

WriteStringToFile

LabWindows/CVI

WriteStringToFile

int WriteStringToFile (FILE *stream, const char string[]);

Purpose

Writes a string to file, converting any newlines to the appropriate line terminators for the system.

This is convenient for writing text to a file that was opened in binary mode.

Parameters

Input
Name Type Description
stream FILE * Specifies which FILE* stream to output the item to. If you specify stdout, then the item is sent to the standard output device, which is usually the console window.
string const char[] Pass the null–terminated array of characters to write to the file. The null terminator is not written to the file.

Any newline (\n) characters in the string are converted to the appropriate line terminators for the system.

Return Value

Name Type Description
result int Returns 0 if the string was written successfully.

Returns a negative User Interface Library error code if an error occurred.

Possible errors:

–97 UIEDiskFull

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later