Associate this object with the specified file descriptor.
Synopsis
Declared in <bdls_fdstreambuf.h>
int
reset(
FilesystemUtil::FileDescriptor fileDescriptor,
bool writableFlag,
bool willCloseOnResetFlag = true,
bool binaryModeFlag = false);
Description
Associate this object with the specified fileDescriptor, and record the state of the specified writableFlag which, if true, indicates that fileDescriptor is writable, otherwise it is not. If, in the call to the constructor or reset prior to this call, willCloseOnReset was true, close any file descriptor previously associated with this object, otherwise leave it open but disassociate this object from it. The Optionally specified willCloseOnResetFlag which will set willCloseOnReset, which, if true, indicates that the specified file descriptor is to be closed when this object is later cleared, reset, or destroyed, otherwise no action will be taken on fileDescriptor at that time. The supplied file descriptor, if valid, should remain open until the next call to either reset or the destructor, regardless of the value of willCloseOnResetFlag. Optionally specify a binaryModeFlag, which is ignored on Unix; if false on Windows, it indicates that `
`s internally are to be translated to and from `\r
` sequences on the device; on Unix or if binaryModeFlag is true no such translation is to occur. Return 0 on success, and a non‐zero value otherwise. Note that if FilesystemUtil::k_INVALID_FD is passed as fileDescriptor, no file descriptor is to be associated with this object. Also note that the state of the fileDescriptor is unchanged by this call, there is no implicit seek.
Return Value
0 on success, and a non‐zero value otherwise
Parameters
Name |
Description |
fileDescriptor |
file descriptor to associate with this object |
writableFlag |
|
willCloseOnResetFlag |
whether to close the descriptor on reset |
binaryModeFlag |
|
Created with MrDocs