Open
Description
@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);
}
}