Function

HexBufferutil_get_file_size

Declaration

gint64
hex_buffer_util_get_file_size (
  GFile* file
)

Description

Utility function to obtain the size of a GFile.

Since 4.6, this function will return an unspecified negative value if the file size was unable to be obtained, as opposed to 0 as it previously did. This is to distinguish between valid zero-length files and files for which the size was not able to be obtained (eg, if it was unreadable). In the future, these negative values may be defined as specific enums which have a more specific meaning. But presently and going forward, testing for a negative value is sufficient to determine that the file size was unobtainable.

Parameters

file

Type: GFile

File to obtain size of.

The data is owned by the caller of the function.

Return value

Type: gint64

The size of the file, in bytes.