Skip to content

Commit 95283b6

Browse files
author
Andrea Tosatto
committed
Improved stat resilience to deleted file
1 parent d659a3d commit 95283b6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@ DerivedData
2222
# Pods - for those of you who use CocoaPods
2323
Pods
2424
update-test.sh
25+
.vscode/
26+
android/.gradle/*
27+
android/gradle/*
28+
android/*.iml
29+
android/local.properties

FS.common.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var getJobId = () => {
2525
return jobId;
2626
};
2727

28-
var normalizeFilePath = (path: string) => (path.startsWith('file://') && !path.startsWith('content://') ? path.slice(7) : path);
28+
var normalizeFilePath = (path: string) => (path.startsWith('file://') ? path.slice(7) : path);
2929

3030
type MkdirOptions = {
3131
NSURLIsExcludedFromBackupKey?: boolean; // iOS only
@@ -42,13 +42,13 @@ type ReadDirItem = {
4242
};
4343

4444
type StatResult = {
45-
name: ?string; // The name of the item
45+
name: ?string; // The name of the item TODO: why is this not documented?
4646
path: string; // The absolute path to the item
4747
size: string; // Size in bytes
4848
mode: number; // UNIX file mode
4949
ctime: number; // Created date
5050
mtime: number; // Last modified date
51-
originalFilepath: ?string; // In case of content uri this is the pointed file path, otherwise is the same as path
51+
originalFilepath: string; // In case of content uri this is the pointed file path, otherwise is the same as path
5252
isFile: () => boolean; // Is the file just a file?
5353
isDirectory: () => boolean; // Is the file a directory?
5454
};

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,12 @@ The promise resolves with an object with the following properties:
383383

384384
```
385385
type StatResult = {
386+
path: // The same as filepath argument
386387
ctime: date; // The creation date of the file
387388
mtime: date; // The last modified date of the file
388389
size: string; // Size in bytes
389390
mode: number; // UNIX file mode
391+
originalFilepath: string; // ANDROID: In case of content uri this is the pointed file path, otherwise is the same as path
390392
isFile: () => boolean; // Is the file just a file?
391393
isDirectory: () => boolean; // Is the file a directory?
392394
};

0 commit comments

Comments
 (0)