Skip to content

Commit

Permalink
Improved stat resilience to deleted file
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Tosatto committed May 10, 2018
1 parent d659a3d commit 95283b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ DerivedData
# Pods - for those of you who use CocoaPods
Pods
update-test.sh
.vscode/
android/.gradle/*
android/gradle/*
android/*.iml
android/local.properties
6 changes: 3 additions & 3 deletions FS.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var getJobId = () => {
return jobId;
};

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

type MkdirOptions = {
NSURLIsExcludedFromBackupKey?: boolean; // iOS only
Expand All @@ -42,13 +42,13 @@ type ReadDirItem = {
};

type StatResult = {
name: ?string; // The name of the item
name: ?string; // The name of the item TODO: why is this not documented?
path: string; // The absolute path to the item
size: string; // Size in bytes
mode: number; // UNIX file mode
ctime: number; // Created date
mtime: number; // Last modified date
originalFilepath: ?string; // In case of content uri this is the pointed file path, otherwise is the same as path
originalFilepath: string; // In case of content uri this is the pointed file path, otherwise is the same as path
isFile: () => boolean; // Is the file just a file?
isDirectory: () => boolean; // Is the file a directory?
};
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,12 @@ The promise resolves with an object with the following properties:

```
type StatResult = {
path: // The same as filepath argument
ctime: date; // The creation date of the file
mtime: date; // The last modified date of the file
size: string; // Size in bytes
mode: number; // UNIX file mode
originalFilepath: string; // ANDROID: In case of content uri this is the pointed file path, otherwise is the same as path
isFile: () => boolean; // Is the file just a file?
isDirectory: () => boolean; // Is the file a directory?
};
Expand Down

0 comments on commit 95283b6

Please sign in to comment.