feat: docker usage examples & statfs

This commit is contained in:
Nicolas Meienberger
2025-09-25 21:13:49 +02:00
parent 86f7ae8a89
commit c261590ea3
16 changed files with 339 additions and 121 deletions

View File

@@ -51,3 +51,13 @@ export async function getMountForPath(p: string): Promise<MountInfo | undefined>
}
return best;
}
export async function getStatFs(mountPoint: string) {
const stats = await fs.statfs(mountPoint);
const total = Number(stats.blocks) * Number(stats.bsize);
const free = Number(stats.bfree) * Number(stats.bsize);
const used = total - free;
return { total, used, free };
}