| 546 | }); |
| 547 | }, |
| 548 | readlink(path, options) { |
| 549 | const pathStr = toPathStr(path); |
| 550 | if (pathStr === null) return undefined; |
| 551 | const normalized = resolve(pathStr); |
| 552 | for (let i = 0; i < activeVFSList.length; i++) { |
| 553 | const vfs = activeVFSList[i]; |
| 554 | if (vfs.shouldHandle(normalized)) { |
| 555 | const promise = vfs.promises.readlink(normalized, options); |
| 556 | if (options?.encoding === 'buffer') { |
| 557 | return promise.then((result) => Buffer.from(result)); |
| 558 | } |
| 559 | return promise; |
| 560 | } |
| 561 | } |
| 562 | return undefined; |
| 563 | }, |
| 564 | chown: (path, uid, gid) => |
| 565 | vfsOp(path, (vfs, n) => vfs.promises.chown(n, uid, gid).then(() => true)), |
| 566 | lchown: (path, uid, gid) => |