#include <SysFile.hpp>
Public Types | |
enum | { DEFAULT_BUFFER_SIZE = 4096 , LINE_POSITIONING_BUFFER = 512 } |
enum | { DEFAULT_BUFFER_SIZE = 4096 , LINE_POSITIONING_BUFFER = 512 } |
Public Member Functions | |
SysFile () | |
bool | open (const char *name, int openFlags, int openMode, int shareMode) |
bool | open (int handle) |
void | reset () |
void | setStdIn () |
void | setStdOut () |
void | setStdErr () |
void | setBuffering (bool buffer, size_t length) |
bool | close () |
bool | flush () |
bool | read (char *buf, size_t len, size_t &bytesRead) |
bool | write (const char *data, size_t len, size_t &bytesWritten) |
bool | putChar (char ch) |
bool | ungetc (char ch) |
bool | getChar (char &ch) |
bool | puts (const char *data, size_t &bytesWritten) |
bool | gets (char *buffer, size_t len, size_t &bytesRead) |
bool | setPosition (int64_t location, int64_t &position) |
bool | seek (int64_t offset, int direction, int64_t &position) |
bool | getPosition (int64_t &position) |
bool | getSize (int64_t &size) |
bool | getSize (const char *name, int64_t &size) |
bool | getTimeStamp (const char *&time) |
bool | getTimeStamp (const char *name, const char *&time) |
bool | putLine (const char *buffer, size_t len, size_t &bytesWritten) |
bool | hasData () |
bool | countLines (int64_t &count) |
bool | countLines (int64_t start, int64_t end, int64_t &lastLine, int64_t &count) |
bool | nextLine (size_t &bytesRead) |
bool | seekForwardLines (int64_t startPosition, int64_t &lineCount, int64_t &endPosition) |
bool | isTransient () |
bool | isDevice () |
bool | isReadable () |
bool | isWriteable () |
bool | isOpen () |
bool | isStdIn () |
bool | error () |
int | errorInfo () |
void | clearErrors () |
bool | atEof () |
bool | hasBufferedInput () |
uintptr_t | getHandle () |
SysFile () | |
bool | open (const char *name, int openFlags, int openMode, int shareMode) |
bool | open (int handle) |
void | reset () |
void | setStdIn () |
void | setStdOut () |
void | setStdErr () |
void | setBuffering (bool buffer, size_t length) |
bool | close () |
bool | flush () |
bool | read (char *buf, size_t len, size_t &bytesRead) |
bool | write (const char *data, size_t len, size_t &bytesWritten) |
bool | putChar (char ch) |
bool | ungetc (char ch) |
bool | getChar (char &ch) |
bool | puts (const char *data, size_t &bytesWritten) |
bool | gets (char *buffer, size_t len, size_t &bytesRead) |
bool | setPosition (int64_t location, int64_t &position) |
bool | seek (int64_t offset, int direction, int64_t &position) |
bool | getPosition (int64_t &position) |
bool | getSize (int64_t &size) |
bool | getSize (const char *name, int64_t &size) |
bool | getTimeStamp (const char *&time) |
bool | getTimeStamp (const char *name, const char *&time) |
bool | putLine (const char *buffer, size_t len, size_t &bytesWritten) |
bool | hasData () |
bool | countLines (int64_t &count) |
bool | countLines (int64_t start, int64_t end, int64_t &lastLine, int64_t &count) |
bool | nextLine (size_t &bytesRead) |
bool | seekForwardLines (int64_t startPosition, int64_t &lineCount, int64_t &endPosition) |
bool | isTransient () |
bool | isDevice () |
bool | isReadable () |
bool | isWriteable () |
bool | isOpen () |
bool | error () |
int | errorInfo () |
void | clearErrors () |
bool | atEof () |
bool | hasBufferedInput () |
uintptr_t | getHandle () |
Static Public Attributes | |
static const int | stdinHandle = 0 |
static const int | stdoutHandle = 1 |
static const int | stderrHandle = 2 |
Protected Member Functions | |
void | getStreamTypeInfo () |
void | getStreamTypeInfo () |
int | writeData (const char *data, size_t length) |
Protected Attributes | |
int | fileHandle |
int | errInfo |
bool | openedHandle |
int | flags |
int | mode |
int | share |
const char * | filename |
bool | buffered |
bool | transient |
bool | device |
bool | writeable |
bool | readable |
bool | isTTY |
char * | buffer |
size_t | bufferSize |
size_t | bufferPosition |
size_t | bufferedInput |
bool | writeBuffered |
bool | append |
int64_t | filePointer |
int | ungetchar |
bool | fileeof |
char * | filename |
Definition at line 72 of file unix/SysFile.hpp.
anonymous enum |
Enumerator | |
---|---|
DEFAULT_BUFFER_SIZE | |
LINE_POSITIONING_BUFFER |
Definition at line 81 of file unix/SysFile.hpp.
anonymous enum |
Enumerator | |
---|---|
DEFAULT_BUFFER_SIZE | |
LINE_POSITIONING_BUFFER |
Definition at line 80 of file windows/SysFile.hpp.
SysFile::SysFile | ( | ) |
Default constructor for a SysFile object.
Definition at line 89 of file unix/SysFile.cpp.
References append, buffer, buffered, bufferedInput, bufferPosition, bufferSize, DEFAULT_BUFFER_SIZE, device, errInfo, fileHandle, filename, filePointer, flags, isTTY, mode, openedHandle, readable, share, ungetchar, writeable, and writeBuffered.
SysFile::SysFile | ( | ) |
|
inline |
Definition at line 128 of file unix/SysFile.hpp.
References fileeof, and hasBufferedInput().
Referenced by StreamInfo::appendVariableLine(), StreamInfo::checkEof(), StreamInfo::readVariableLine(), and seekForwardLines().
|
inline |
Definition at line 126 of file windows/SysFile.hpp.
References fileHandle, and hasBufferedInput().
|
inline |
Definition at line 127 of file unix/SysFile.hpp.
References errInfo.
Referenced by StreamInfo::implicitOpen(), and StreamInfo::notreadyError().
|
inline |
Definition at line 125 of file windows/SysFile.hpp.
References errInfo.
bool SysFile::close | ( | ) |
Close the stream, and free all associated resources.
Definition at line 265 of file unix/SysFile.cpp.
References buffer, buffered, errInfo, fileHandle, filename, flush(), and openedHandle.
Referenced by StreamInfo::close(), MacroSpaceFile::close(), LocalMacroSpaceManager::translateRexxProgram(), and MacroSpaceFile::~MacroSpaceFile().
bool SysFile::close | ( | ) |
bool SysFile::countLines | ( | int64_t & | count | ) |
Count the number of lines in the stream, starting from the current file pointer position.
count | The returned line count. |
Definition at line 692 of file unix/SysFile.cpp.
References nextLine().
Referenced by StreamInfo::countStreamLines(), StreamInfo::queryLinePosition(), and StreamInfo::setLinePositions().
bool SysFile::countLines | ( | int64_t & | count | ) |
Count the number of lines between two character positions.
start | The starting offset. |
end | The ending offset |
lastLine | The starting offset of the last line before the end position. |
count | The returned offset |
Definition at line 720 of file unix/SysFile.cpp.
References nextLine(), and seek().
|
inline |
Definition at line 125 of file unix/SysFile.hpp.
References errInfo.
Referenced by gets(), and nextLine().
|
inline |
Definition at line 123 of file windows/SysFile.hpp.
References errInfo.
|
inline |
Definition at line 126 of file unix/SysFile.hpp.
References errInfo.
Referenced by StreamInfo::close(), StreamInfo::implicitOpen(), StreamInfo::notreadyError(), StreamInfo::streamFlush(), and StreamInfo::streamOpen().
|
inline |
Definition at line 124 of file windows/SysFile.hpp.
References errInfo.
bool SysFile::flush | ( | ) |
Flush the stream buffers.
Definition at line 312 of file unix/SysFile.cpp.
References buffer, buffered, bufferedInput, bufferPosition, errInfo, fileHandle, filePointer, write(), and writeBuffered.
Referenced by close(), getSize(), read(), reset(), seekForwardLines(), setPosition(), StreamInfo::streamFlush(), and write().
bool SysFile::flush | ( | ) |
bool SysFile::getChar | ( | char & | ch | ) |
bool SysFile::getChar | ( | char & | ch | ) |
|
inline |
Definition at line 130 of file unix/SysFile.hpp.
References fileHandle.
Referenced by StreamInfo::queryHandle().
|
inline |
Definition at line 128 of file windows/SysFile.hpp.
References fileHandle.
bool SysFile::getPosition | ( | int64_t & | position | ) |
Definition at line 962 of file unix/SysFile.cpp.
References buffered, bufferedInput, bufferPosition, fileHandle, filePointer, and writeBuffered.
Referenced by StreamInfo::lineReadIncrement(), StreamInfo::queryStreamPosition(), StreamInfo::readSetup(), StreamInfo::writeBuffer(), StreamInfo::writeLine(), and StreamInfo::writeSetup().
bool SysFile::getPosition | ( | int64_t & | position | ) |
bool SysFile::gets | ( | char * | buffer, |
size_t | len, | ||
size_t & | bytesRead | ||
) |
Definition at line 636 of file unix/SysFile.cpp.
References error(), and read().
Referenced by StreamInfo::appendVariableLine(), and StreamInfo::readVariableLine().
bool SysFile::gets | ( | char * | buffer, |
size_t | len, | ||
size_t & | bytesRead | ||
) |
bool SysFile::getSize | ( | const char * | name, |
int64_t & | size | ||
) |
Retrieve the size of a file from the file name. If the name is a device, it zero is returned.
size | The returned size value. |
Definition at line 1026 of file unix/SysFile.cpp.
bool SysFile::getSize | ( | const char * | name, |
int64_t & | size | ||
) |
bool SysFile::getSize | ( | int64_t & | size | ) |
Retrieve the size of the stream. If the stream is open, it returns the stream size. Zero is returned if this stream is not a regular file.
size | The returned size value. |
Definition at line 992 of file unix/SysFile.cpp.
References fileHandle, and flush().
Referenced by StreamInfo::getStreamSize(), hasData(), seek(), StreamInfo::size(), and LocalMacroSpaceManager::translateRexxProgram().
bool SysFile::getSize | ( | int64_t & | size | ) |
|
protected |
Determine the stream characteristics after an open.
Definition at line 1104 of file unix/SysFile.cpp.
References device, fileHandle, isTTY, readable, and writeable.
Referenced by open(), setStdErr(), setStdIn(), and setStdOut().
|
protected |
bool SysFile::getTimeStamp | ( | const char *& | time | ) |
Retrieve the size of the stream. If the stream is open, it returns the stream size. Zero is returned if this stream is not a regular file.
size | The returned size value. |
Definition at line 1055 of file unix/SysFile.cpp.
References fileHandle.
Referenced by StreamInfo::getTimeStamp().
bool SysFile::getTimeStamp | ( | const char *& | time | ) |
bool SysFile::getTimeStamp | ( | const char * | name, |
const char *& | time | ||
) |
Retrieve the size of a file from the file name. If the name is a device, it zero is returned.
size | The returned size value. |
Definition at line 1083 of file unix/SysFile.cpp.
bool SysFile::getTimeStamp | ( | const char * | name, |
const char *& | time | ||
) |
|
inline |
Definition at line 129 of file unix/SysFile.hpp.
References buffered, bufferedInput, and bufferPosition.
|
inline |
Definition at line 127 of file windows/SysFile.hpp.
References buffered, bufferedInput, and bufferPosition.
bool SysFile::hasData | ( | ) |
Check to see if a stream still has data.
Check to see if a stream still has data.
Definition at line 1208 of file unix/SysFile.cpp.
References fileeof, fileHandle, getSize(), hasBufferedInput(), isStdIn(), isTTY, and readable.
Referenced by StreamInfo::chars(), and StreamInfo::lines().
bool SysFile::hasData | ( | ) |
|
inline |
Definition at line 119 of file unix/SysFile.hpp.
References device.
Referenced by StreamInfo::streamExists(), and StreamInfo::streamOpen().
|
inline |
Definition at line 118 of file windows/SysFile.hpp.
References device.
|
inline |
Definition at line 122 of file unix/SysFile.hpp.
References fileHandle.
Referenced by StreamInfo::implicitOpen().
|
inline |
Definition at line 121 of file windows/SysFile.hpp.
References fileHandle.
|
inline |
Definition at line 120 of file unix/SysFile.hpp.
References readable.
|
inline |
Definition at line 119 of file windows/SysFile.hpp.
References readable.
|
inline |
Definition at line 123 of file unix/SysFile.hpp.
References fileHandle, and stdinHandle.
Referenced by hasData().
|
inline |
Definition at line 118 of file unix/SysFile.hpp.
Referenced by StreamInfo::chars(), StreamInfo::checkStreamType(), StreamInfo::handleOpen(), StreamInfo::implicitOpen(), StreamInfo::lines(), StreamInfo::openStd(), StreamInfo::readSetup(), and StreamInfo::streamOpen().
|
inline |
Definition at line 117 of file windows/SysFile.hpp.
|
inline |
Definition at line 121 of file unix/SysFile.hpp.
References writeable.
|
inline |
Definition at line 120 of file windows/SysFile.hpp.
References writeable.
bool SysFile::nextLine | ( | size_t & | bytesRead | ) |
Move to the beginning of the next line in the stream, returning a count of the bytes moved forward.
bytesRead | The returned byte count for the line (including the terminators). |
Definition at line 761 of file unix/SysFile.cpp.
References error(), and getChar().
Referenced by countLines().
bool SysFile::nextLine | ( | size_t & | bytesRead | ) |
bool SysFile::open | ( | const char * | name, |
int | openFlags, | ||
int | openMode, | ||
int | shareMode | ||
) |
Opens a file. This opens the file for both lowlevel I/O and also for higher level I/O.
name | Name of the stream. |
openFlags | The open flags. This are the same flags used on the open() function. |
Opens a file. This opens the file for both lowlevel I/O and also for higher level I/O.
name | Name of the stream. |
openFlags | The open flags. This are the same flags used on the _sopen() function. |
openMode | Open mode. Same flag values as _sopen(). |
fdopenMode | fdopenMode character string. Same as values use for the fdopen() function. |
shareMode | The sharing mode. Same as used by the _sopen() library function. |
Definition at line 129 of file unix/SysFile.cpp.
References append, errInfo, fileeof, fileHandle, filename, flags, getStreamTypeInfo(), isTTY, openedHandle, RX_O_APPEND, setBuffering(), and ungetchar.
Referenced by MacroSpaceFile::create(), StreamInfo::open(), MacroSpaceFile::openForLoading(), StreamInfo::setHandle(), and LocalMacroSpaceManager::translateRexxProgram().
bool SysFile::open | ( | const char * | name, |
int | openFlags, | ||
int | openMode, | ||
int | shareMode | ||
) |
bool SysFile::open | ( | int | handle | ) |
Open a stream using a provided handle value.
handle | The source stream handle. |
fdopenMode | The fdopen() mode flags for the stream. |
Open a stream using a provided handle value.
handle | The source stream handle. |
fdopenMode | The fdopen() mode flags for the stream. |
Definition at line 188 of file unix/SysFile.cpp.
References fileHandle, getStreamTypeInfo(), isTTY, openedHandle, setBuffering(), and ungetchar.
bool SysFile::open | ( | int | handle | ) |
bool SysFile::putChar | ( | char | ch | ) |
Definition at line 580 of file unix/SysFile.cpp.
References write().
bool SysFile::putChar | ( | char | ch | ) |
bool SysFile::putLine | ( | const char * | buffer, |
size_t | len, | ||
size_t & | bytesWritten | ||
) |
Write a line to the stream, adding the platform specific line terminator.
mybuffer | Start of the line to write. |
len | The length to write. |
bytesWritten | The actual number of bytes written, including the line terminator. |
Write a line to the stream, adding the platform specific line terminator.
buffer | Start of the line to write. |
len | The length to write. |
bytesWritten | The actual number of bytes written, including the line terminator. |
Definition at line 616 of file unix/SysFile.cpp.
References LINE_TERMINATOR, puts(), and write().
Referenced by StreamInfo::writeLine().
bool SysFile::putLine | ( | const char * | buffer, |
size_t | len, | ||
size_t & | bytesWritten | ||
) |
bool SysFile::puts | ( | const char * | data, |
size_t & | bytesWritten | ||
) |
bool SysFile::puts | ( | const char * | data, |
size_t & | bytesWritten | ||
) |
bool SysFile::read | ( | char * | buf, |
size_t | len, | ||
size_t & | bytesRead | ||
) |
Read bytes from the stream.
buf | The buffer to read into. |
len | The requested number of bytes to read. |
bytesRead | The actual number of bytes read. |
Definition at line 346 of file unix/SysFile.cpp.
References buffer, buffered, bufferedInput, bufferPosition, bufferSize, errInfo, fileeof, fileHandle, filePointer, flush(), ungetchar, and writeBuffered.
Referenced by getChar(), gets(), StreamInfo::handleOpen(), StreamInfo::implicitOpen(), MacroSpaceFile::read(), StreamInfo::readBuffer(), StreamInfo::readLine(), LocalMacroSpaceManager::readRxstringFromFile(), seekForwardLines(), and StreamInfo::streamOpen().
bool SysFile::read | ( | char * | buf, |
size_t | len, | ||
size_t & | bytesRead | ||
) |
void SysFile::reset | ( | void | ) |
Reset this to an unopened state.
Definition at line 212 of file unix/SysFile.cpp.
References buffer, fileHandle, and flush().
Referenced by StreamInfo::resetFields().
void SysFile::reset | ( | ) |
Definition at line 907 of file unix/SysFile.cpp.
References buffered, bufferedInput, bufferPosition, errInfo, fileHandle, filePointer, getSize(), and setPosition().
Referenced by countLines(), MacroSpaceFile::setFilePosition(), and StreamInfo::setPosition().
bool SysFile::seekForwardLines | ( | int64_t | startPosition, |
int64_t & | lineCount, | ||
int64_t & | endPosition | ||
) |
Definition at line 787 of file unix/SysFile.cpp.
References atEof(), errInfo, flush(), LINE_POSITIONING_BUFFER, read(), and setPosition().
Referenced by StreamInfo::readForwardByLine().
bool SysFile::seekForwardLines | ( | int64_t | startPosition, |
int64_t & | lineCount, | ||
int64_t & | endPosition | ||
) |
void SysFile::setBuffering | ( | bool | buffering, |
size_t | length | ||
) |
Controls buffering for this stream.
buffer | True or false depending on the desired buffering mode. |
Definition at line 229 of file unix/SysFile.cpp.
References buffer, buffered, bufferedInput, bufferPosition, DEFAULT_BUFFER_SIZE, and writeBuffered.
Referenced by open(), StreamInfo::openStd(), setStdErr(), setStdIn(), setStdOut(), and StreamInfo::streamOpen().
void SysFile::setBuffering | ( | bool | buffer, |
size_t | length | ||
) |
Definition at line 866 of file unix/SysFile.cpp.
References bufferedInput, bufferPosition, errInfo, fileHandle, filePointer, flush(), and writeBuffered.
Referenced by seek(), and seekForwardLines().
void SysFile::setStdErr | ( | ) |
Set a SysFile object to the stderr stream.
Definition at line 1184 of file unix/SysFile.cpp.
References fileHandle, getStreamTypeInfo(), openedHandle, setBuffering(), stderrHandle, ungetchar, and writeable.
Referenced by StreamInfo::openStd().
void SysFile::setStdErr | ( | ) |
void SysFile::setStdIn | ( | ) |
Set a SysFile object to be the standard output stream.
Definition at line 1149 of file unix/SysFile.cpp.
References fileHandle, getStreamTypeInfo(), openedHandle, readable, setBuffering(), stdinHandle, and ungetchar.
Referenced by StreamInfo::openStd().
void SysFile::setStdIn | ( | ) |
void SysFile::setStdOut | ( | ) |
Set a SysFile object to the standard output stream.
Definition at line 1166 of file unix/SysFile.cpp.
References fileHandle, getStreamTypeInfo(), openedHandle, setBuffering(), stdoutHandle, ungetchar, and writeable.
Referenced by StreamInfo::openStd().
void SysFile::setStdOut | ( | ) |
bool SysFile::ungetc | ( | char | ch | ) |
Definition at line 586 of file unix/SysFile.cpp.
References ungetchar.
bool SysFile::ungetc | ( | char | ch | ) |
bool SysFile::write | ( | const char * | data, |
size_t | len, | ||
size_t & | bytesWritten | ||
) |
write data to the stream
data | The data buffer to write. |
len | The length to write |
bytesWritten | The number bytes actually written (return value). |
Definition at line 471 of file unix/SysFile.cpp.
References buffer, buffered, bufferedInput, bufferPosition, bufferSize, errInfo, fileHandle, filePointer, flags, flush(), and writeBuffered.
Referenced by flush(), putChar(), putLine(), puts(), MacroSpaceFile::write(), and StreamInfo::writeBuffer().
bool SysFile::write | ( | const char * | data, |
size_t | len, | ||
size_t & | bytesWritten | ||
) |
|
protected |
Wrapper around _write to handle block size issues with device streams.
data | The data to write. |
length | The data length. |
Definition at line 406 of file windows/SysFile.cpp.
References BLOCK_THRESHOLD, device, and fileHandle.
|
protected |
Definition at line 153 of file unix/SysFile.hpp.
|
protected |
Definition at line 148 of file unix/SysFile.hpp.
Referenced by close(), flush(), read(), reset(), setBuffering(), SysFile(), and write().
|
protected |
Definition at line 142 of file unix/SysFile.hpp.
Referenced by close(), flush(), getPosition(), hasBufferedInput(), read(), seek(), setBuffering(), SysFile(), and write().
|
protected |
Definition at line 151 of file unix/SysFile.hpp.
Referenced by flush(), getPosition(), hasBufferedInput(), read(), seek(), setBuffering(), setPosition(), SysFile(), and write().
|
protected |
Definition at line 150 of file unix/SysFile.hpp.
Referenced by flush(), getPosition(), hasBufferedInput(), read(), seek(), setBuffering(), setPosition(), SysFile(), and write().
|
protected |
Definition at line 149 of file unix/SysFile.hpp.
|
protected |
Definition at line 144 of file unix/SysFile.hpp.
Referenced by getStreamTypeInfo(), isDevice(), SysFile(), and writeData().
|
protected |
Definition at line 136 of file unix/SysFile.hpp.
Referenced by clearErrors(), close(), error(), errorInfo(), flush(), open(), read(), seek(), seekForwardLines(), setPosition(), SysFile(), and write().
|
protected |
|
protected |
Definition at line 135 of file unix/SysFile.hpp.
Referenced by atEof(), close(), flush(), getHandle(), getPosition(), getSize(), getStreamTypeInfo(), getTimeStamp(), hasData(), isOpen(), isStdIn(), open(), read(), reset(), seek(), setPosition(), setStdErr(), setStdIn(), setStdOut(), SysFile(), write(), and writeData().
|
protected |
Definition at line 141 of file unix/SysFile.hpp.
|
protected |
Definition at line 140 of file windows/SysFile.hpp.
|
protected |
Definition at line 154 of file unix/SysFile.hpp.
Referenced by flush(), getPosition(), read(), seek(), setPosition(), SysFile(), and write().
|
protected |
Definition at line 138 of file unix/SysFile.hpp.
|
protected |
Definition at line 147 of file unix/SysFile.hpp.
Referenced by getStreamTypeInfo(), hasData(), open(), and SysFile().
|
protected |
Definition at line 139 of file unix/SysFile.hpp.
Referenced by SysFile().
|
protected |
Definition at line 137 of file unix/SysFile.hpp.
Referenced by close(), open(), setStdErr(), setStdIn(), setStdOut(), and SysFile().
|
protected |
Definition at line 146 of file unix/SysFile.hpp.
Referenced by getStreamTypeInfo(), hasData(), isReadable(), setStdIn(), and SysFile().
|
protected |
Definition at line 140 of file unix/SysFile.hpp.
Referenced by SysFile().
|
static |
Definition at line 79 of file unix/SysFile.hpp.
Referenced by setStdErr().
|
static |
Definition at line 77 of file unix/SysFile.hpp.
Referenced by isStdIn(), and setStdIn().
|
static |
Definition at line 78 of file unix/SysFile.hpp.
Referenced by setStdOut().
|
protected |
Definition at line 143 of file unix/SysFile.hpp.
|
protected |
Definition at line 155 of file unix/SysFile.hpp.
Referenced by open(), read(), setStdErr(), setStdIn(), setStdOut(), SysFile(), and ungetc().
|
protected |
Definition at line 145 of file unix/SysFile.hpp.
Referenced by getStreamTypeInfo(), isWriteable(), setStdErr(), setStdOut(), and SysFile().
|
protected |
Definition at line 152 of file unix/SysFile.hpp.
Referenced by flush(), getPosition(), read(), setBuffering(), setPosition(), SysFile(), and write().