mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: docker usage examples & statfs
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user