| 471 | } |
| 472 | |
| 473 | public stat(path: string, isLstat: boolean, cb: BFSCallback<Stats>): void { |
| 474 | // Ignore lstat case -- Dropbox doesn't support symlinks |
| 475 | // Stat the file |
| 476 | this._client.stat(path, (error, stat) => { |
| 477 | if (error) { |
| 478 | cb(this.convert(error, path)); |
| 479 | } else if (stat && stat.isRemoved) { |
| 480 | // Dropbox keeps track of deleted files, so if a file has existed in the |
| 481 | // past but doesn't any longer, you wont get an error |
| 482 | cb(ApiError.FileError(ErrorCode.ENOENT, path)); |
| 483 | } else { |
| 484 | const stats = new Stats(this._statType(stat!), stat!.size); |
| 485 | return cb(null, stats); |
| 486 | } |
| 487 | }); |
| 488 | } |
| 489 | |
| 490 | public open(path: string, flags: FileFlag, mode: number, cb: BFSCallback<File>): void { |
| 491 | // Try and get the file's contents |