stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

feat: `get_file_size` - gets the size of a file in bytes

Open wassup05 opened this issue 4 months ago • 0 comments

User facing function added is get_file_size(path [, err])

It returns the file size in bytes. It returns an error if the path is a directory or a symlink to a directory (because for the size of directories you will need to recurse into the directory and add all its component sizes to get its actual size)

It uses stat and _stati64 on POSIX and windows respectively. It returns an integer of kind int64 to handle large enough file sizes.

wassup05 avatar Aug 23 '25 11:08 wassup05