WriteLine
- Updated2023-02-21
- 2 minute(s) read
int WriteLine (int fileHandle, char lineBuffer[], ssize_t numberOfBytes);
Purpose
Writes numberOfBytes bytes from lineBuffer to a file and then writes a linefeed (LF) to the file.
Parameters
Input | ||||
Name | Type | Description | ||
fileHandle | int | Specifies the file to which the line is to be written. Call OpenFile to obtain a fileHandle. Open the file in ASCII mode so that WriteLine writes a carriage return (CR) before each LF. If fileHandle is 1, WriteLine writes the line to the Standard Output. |
||
lineBuffer | char [] | Specifies the buffer from which the line is to be written. | ||
numberOfBytes | ssize_t | Number of bytes to write from the buffer to the file. If numberOfBytes is –1, WriteLine writes only the bytes in lineBuffer before the first ASCII NUL, followed by an LF. The function returns an error if you pass a value greater than INT_MAX.
|
Return Value
Name | Type | Description |
bytesWritten | int | Number of bytes written to the file, excluding the LF. A value of –1 indicates that an error occurred during the write operation, possibly because of a bad file handle or because the file was opened in read only mode. You can use GetFmtIOError to get more information about the type of error that occurred. |
Additional Information
Library: Formatting and I/O Library
Include file: formatio.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later