MCPcopy Index your code
hub / github.com/jvilk/BrowserFS / readdir

Method readdir

src/generic/key_value_filesystem.ts:931–942  ·  view source on GitHub ↗
(p: string, cb: BFSCallback<string[]>)

Source from the content-addressed store, hash-verified

929 }
930
931 public readdir(p: string, cb: BFSCallback<string[]>): void {
932 const tx = this.store.beginTransaction('readonly');
933 this.findINode(tx, p, (e: ApiError, inode?: Inode) => {
934 if (noError(e, cb)) {
935 this.getDirListing(tx, p, inode!, (e: ApiError, dirListing?: {[name: string]: string}) => {
936 if (noError(e, cb)) {
937 cb(null, Object.keys(dirListing));
938 }
939 });
940 }
941 });
942 }
943
944 public _sync(p: string, data: Buffer, stats: Stats, cb: BFSOneArgCallback): void {
945 // @todo Ensure mtime updates properly, and use that to determine if a data

Callers 1

rmdirMethod · 0.95

Calls 5

findINodeMethod · 0.95
getDirListingMethod · 0.95
noErrorFunction · 0.85
cbFunction · 0.85
beginTransactionMethod · 0.65

Tested by

no test coverage detected