MCPcopy
hub / github.com/jvilk/BrowserFS / stat

Method stat

src/backend/Dropbox.ts:473–488  ·  view source on GitHub ↗
(path: string, isLstat: boolean, cb: BFSCallback<Stats>)

Source from the content-addressed store, hash-verified

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

Callers 1

_writeFileStrictMethod · 0.95

Calls 5

convertMethod · 0.95
_statTypeMethod · 0.95
cbFunction · 0.85
FileErrorMethod · 0.80
statMethod · 0.65

Tested by

no test coverage detected