stdlib
stdlib copied to clipboard
feat: `get_file_size` - gets the size of a file in bytes
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.