* 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>)
| 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 |
no test coverage detected