Repository navigation
Add fs.statvfs function to get disk size/free/available space + other info #10745
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
on Jan 11, 2017 libuv would need to add such support first, then node would add an API that uses that libuv API.
- addedlibuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.
on Jan 11, 2017 From what I can tell, the modules you linked to only provide a subset of what
statvfs(). libuv would also require a Windows implementation. It looks like Python rejected a Windows implementation a while back (not sure if that has since changed).cc: @saghul
@miniak I use https://www.npmjs.com/package/storage-device-info, which only depends on NAN. Regardless though, it would be nice to have this built-in.
- I'm not opposed to it, proven that there is a reasonable implementation for all our supported platforms.…On Wed, Jan 11, 2017 at 10:11 PM, Colin Ihrig ***@***.***> wrote: From what I can tell, the modules you linked to only provide a subset of what statvfs(). libuv would also require a Windows implementation. It looks like Python rejected a Windows implementation a while back (not sure if that has since changed). cc: @saghul <https://github.com/saghul> — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#10745 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AATYGKUndJ91Q_f6zCFglPz2ht1KbyI3ks5rRafbgaJpZM4Lg_h1> .-- /Saúl bettercallsaghul.com
Given that this issue has been inactive for several months, is it sensible close this (or at least mark is at blocked) unless and until the necessary features are added to libuv?
I think this is still valid, regardless of people having have spent time on it.
- addedblockedPRs that are blocked by other issues or PRs.PRs that are blocked by other issues or PRs.
on Jul 16, 2017 - addedhelp wantedIssues that need assistance from volunteers or PRs that need help to proceed.Issues that need assistance from volunteers or PRs that need help to proceed.
on Jul 17, 2017 https://github.com/jduncanator/node-diskusage now implements in C++, it also have a Windows implementation.
Reacted by Erica WindischPut into https://github.com/nodejs/node/projects/13 backlog
Reacted by Ron KorvingSo is this happening or not? I see it on the project dashboard but it's now closed?
10 remaining items
please reopen this issue, is not resolved yet.
Reacted by Leon White, bkarlson, Mori, Daniel, Peter Pistorius, jeetuv and EagleLizardIs there any ETA for this? Stats does not show the size on disk, which is an issue because it reports file sizes of
<20Bon disks, when the actual minimum block size for files on a given disk may be~4096B, so disk calcs end up with significant mismatches- added a commit that references this issue
on Jan 29, 2023 For example, let's find out the free disk space as a percentage:
/* https://nodejs.org/api/fs.html#fspromisesstatfspath-options */ const fsp = require("node:fs/promises"); (async function (){ const { bfree, blocks } = await fsp.statfs(__dirname) const persent = bfree/blocks*100 console.log({persent}) })()
This issue can been closed for years. If you're experiencing an issue, please open a new issue in nodejs/help.
Reacted by Claudia Meadows
There is no build in way to get disk space information. There are a few npm modules available:
This is such a basic API that should be built-in.