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

Method getINode

src/generic/key_value_filesystem.ts:1069–1079  ·  view source on GitHub ↗

* Given the ID of a node, retrieves the corresponding Inode. * @param tx The transaction to use. * @param p The corresponding path to the file (used for error messages). * @param id The ID to look up. * @param cb Passed an error or the inode under the given id.

(tx: AsyncKeyValueROTransaction, p: string, id: string, cb: BFSCallback<Inode>)

Source from the content-addressed store, hash-verified

1067 * @param cb Passed an error or the inode under the given id.
1068 */
1069 private getINode(tx: AsyncKeyValueROTransaction, p: string, id: string, cb: BFSCallback<Inode>): void {
1070 tx.get(id, (e: ApiError, data?: Buffer): void => {
1071 if (noError(e, cb)) {
1072 if (data === undefined) {
1073 cb(ApiError.ENOENT(p));
1074 } else {
1075 cb(null, Inode.fromBuffer(data));
1076 }
1077 }
1078 });
1079 }
1080
1081 /**
1082 * Given the Inode of a directory, retrieves the corresponding directory

Callers 5

theOleSwitcharooMethod · 0.95
_syncMethod · 0.95
_findINodeMethod · 0.95
findINodeMethod · 0.95
removeEntryMethod · 0.95

Calls 5

noErrorFunction · 0.85
cbFunction · 0.85
ENOENTMethod · 0.80
getMethod · 0.65
fromBufferMethod · 0.45

Tested by

no test coverage detected