Difference between g_file_info_get_size() and G_FILE_ATTRIBUTE_STANDARD_SIZE


I am wondering what the difference between the result of g_file_info_get_size(GFileInfo *info) (with result type goffset, where typedef gint64 goffset;, see link) and retrieving the file size with the help of G_FILE_ATTRIBUTE_STANDARD_SIZE (type of uint64, see link) is.

Can somebody explain me if there is a difference? In which cases should I use which approach to get the size of a file?

Thank you

Use the source, Luke!


g_file_info_get_size() returns the same number but cast to a goffset.

1 Like

Wow :laughing:, thanks, Philip. :+1:

That should probably be added to the documentation to prevent this confusion in the future. Someone wants to create an issue or directly send an MR?

1 Like

I have opened an issue.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.