-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Function to get file size #7466
Comments
CC @roberth @aakropotkin as we were talking about this in #7447 |
@shyim What are the use cases for such a function? |
I generate a JSON for Wiremock (API mocking) in Nix and to mock an update service I need the sha1, sha256 of that file and the fileSize. Sha is already possible and didn't found a proper way to get the fileSize so I came to this issue :) |
Hmm, this doesn't sound very convincing, it's not really a use case Nix is meant for, and I feel like there's many ways to achieve the same result without Nix. |
If it were possible to lock inputs with If you really want filesize as a built in it's a great opportunity to write a small plugin though. |
with plugin you mean a PR here? 🤔 |
Adding the file size to lock files (or FOD hashes!) is nice for giving an indication of total download size. There's a case to be made for that, but locking is not implemented in the Nix language, so I don't see that as a use case for a file size builtin. Of course fileSize is derived info that is merely convenient to store in a lock file, and not essential.
This sounds very hypothetical
Now we're talking. |
Is your feature request related to a problem? Please describe.
Currently, we are able to hash a file and read a file, but we can't get the file size
Describe the solution you'd like
I would like to have a function to get the file size of the given path
Describe alternatives you've considered
Additional context
Add any other context or screenshots about the feature request here.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: