Return the size, in bytes, of the file or directory at path.

Synopsis

Declared in <bdls_filesystemutil.h>

static
Offset
getFileSize(char const* path);

Description

Return the size, in bytes, of the file or directory at the specified path, or a negative value if an error occurs. Note that the size of a symbolic link is the size of the file or directory to which it points. The parameterized STRING_TYPE must be one of bsl::string, std::string, std::pmr::string (if supported), bsl::string_view, or bslstl::StringRef.

Return Value

the size in bytes, or a negative value if an error occurs

Parameters

Name

Description

path

filesystem path of the file or directory

Created with MrDocs