Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

wassup05
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant