BloombergLP::bdls::FilesystemUtil::read

Read numBytes from the file with descriptor into buffer.

Synopsis

Declared in <bdls_filesystemutil.h>

static
int
read(
    FileDescriptor descriptor,
    void* buffer,
    int numBytes);

Description

Read the specified numBytes bytes beginning at the file pointer of the file with the specified descriptor into the specified buffer. Return numBytes on success; the number of bytes read if there were not enough available; or a negative number on some other error.

Return Value

numBytes on success; the number of bytes read if fewer were available; or a negative number on error

Parameters

NameDescription
descriptorfile descriptor of the file to read
bufferbuffer into which bytes are read
numBytesnumber of bytes to read