Skip to content
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

fs.stat, fs.statSync do not support files > 2GB #3868

Closed
asilvas opened this issue Jul 29, 2023 · 2 comments
Closed

fs.stat, fs.statSync do not support files > 2GB #3868

asilvas opened this issue Jul 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@asilvas
Copy link
Contributor

asilvas commented Jul 29, 2023

What version of Bun is running?

0.7.1

What platform is your computer?

Linux 6.2.0-26-generic x86_64 x86_64

What steps can reproduce the bug?

import fs from "fs";
import assert from "assert";

const BIG_FILE = "some_file_bigger_than_2GB";
const BIG_FILE_SIZE = 15438888903; // actual file size
const bigFileStat = fs.statSync(BIG_FILE, { bigint: false });
assert(
  bigFileStat.size === BIG_FILE_SIZE,
  `File ${BIG_FILE} should be ${BIG_FILE_SIZE}B but was ${bigFileStat.size}B`
);

What is the expected behavior?

Should work with and without bigint set.

What do you see instead?

Negative values.

Additional information

No response

@asilvas asilvas added the bug Something isn't working label Jul 29, 2023
@asilvas
Copy link
Contributor Author

asilvas commented Jul 29, 2023

Duplicate of #849

@Jarred-Sumner
Copy link
Collaborator

Thanks for reminding

@Jarred-Sumner Jarred-Sumner mentioned this issue Jul 29, 2023
2 tasks
trnxdev pushed a commit to trnxdev/bun that referenced this issue Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants