-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fs.statvfs function to get disk size/free/available space + other info #10745
Comments
libuv would need to add such support first, then node would add an API that uses that libuv API. |
From what I can tell, the modules you linked to only provide a subset of what 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. |
https://github.com/jduncanator/node-diskusage now implements in C++, it also have a Windows implementation. |
Put into https://github.com/nodejs/node/projects/13 backlog |
So is this happening or not? I see it on the project dashboard but it's now closed? |
@refack |
@sagitsofan should be opened in libuv/libuv as a feature request, if it can be implemented portably in libuv, then node could expose it. |
@sam-github But if we can integrated directly inside node the |
@sagitsofan But we like to depend on uv! Its not a burden, its our compat layer. |
If anyone really wants to see this in Node, I'd recommend opening an issue on the libuv issue tracker. The feature request should describe what the API would look like, taking a Windows implementation into consideration. This python issue is old, but might still be relevant. |
So after this feature has been added into libuv core, when will it be available inside node js project? |
I'm planning a libuv release for this week. I'll also have to expose the API in Node. It should be available in the next one or two Node 12.x releases. |
I would be happy to expose the API in node after the libuv release. |
@sagitsofan were you volunteering to write the |
Sure, i am on it. |
Use the uv_fs_statfs() function in libuv to add support for statfs system call to the fs module. Refs: nodejs#10745
Add support for statfs system call to the fs module using uv_fs_statfs() function from libuv. Refs: nodejs#10745
please reopen this issue, is not resolved yet. |
Is there any ETA for this? Stats does not show the size on disk, which is an issue because it reports file sizes of |
This commit adds statfs() and statfsSync() to the fs module, and statfs() to the fsPromises module. Co-authored-by: cjihrig <cjihrig@gmail.com> Fixes: nodejs#10745 Refs: nodejs#31351
This commit adds statfs() and statfsSync() to the fs module, and statfs() to the fsPromises module. Co-authored-by: cjihrig <cjihrig@gmail.com> Fixes: nodejs#10745 Refs: nodejs#31351
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. |
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.
The text was updated successfully, but these errors were encountered: