* Given the Inode of a directory, retrieves the corresponding directory * listing.
(tx: SyncKeyValueROTransaction, p: string, inode: Inode)
| 502 | * listing. |
| 503 | */ |
| 504 | private getDirListing(tx: SyncKeyValueROTransaction, p: string, inode: Inode): { [fileName: string]: string } { |
| 505 | if (!inode.isDirectory()) { |
| 506 | throw ApiError.ENOTDIR(p); |
| 507 | } |
| 508 | const data = tx.get(inode.id); |
| 509 | if (data === undefined) { |
| 510 | throw ApiError.ENOENT(p); |
| 511 | } |
| 512 | return JSON.parse(data.toString()); |
| 513 | } |
| 514 | |
| 515 | /** |
| 516 | * Creates a new node under a random ID. Retries 5 times before giving up in |
no test coverage detected