itinance / itinance/react-native-fs

big file stat file size overflow

Open
#226 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

```javascript
@ReactMethod
public void stat(String filepath, Promise promise) {
try {
File file = new File(filepath);

if (!file.exists()) throw new Exception("File does not exist");

WritableMap statMap = Arguments.createMap();

statMap.putInt("ctime", (int)(file.lastModified() / 1000));
statMap.putInt("mtime", (int)(file.lastModified() / 1000));
statMap.putInt("size",(int)file.length());//-->max size 966356656 byte~=970M
--->statMap.putDouble("size",(double)file.length());
statMap.putInt("type", file.isDirectory() ? 1 : 0);

promise.resolve(statMap);
} catch (Exception ex) {
ex.printStackTrace();
reject(promise, filepath, ex);
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.