Skip to content

os: add disk_usage()#23634

Merged
spytheman merged 6 commits into
vlang:masterfrom
kbkpbot:os_add_disk_usage
Feb 2, 2025
Merged

os: add disk_usage()#23634
spytheman merged 6 commits into
vlang:masterfrom
kbkpbot:os_add_disk_usage

Conversation

@kbkpbot

@kbkpbot kbkpbot commented Feb 2, 2025

Copy link
Copy Markdown
Contributor

disk_usage(path) returns disk usage of path
Examples:

pub struct DiskUsage {
pub:
        total     u64
        available u64
        used      u64
}

usage := os.disk_usage('.')!
assert usage.total > 0
assert usage.available > 0
assert usage.used > 0

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-22058

Comment thread vlib/os/os_nix.c.v Outdated
@spytheman spytheman changed the title os:add disk_usage() os: add disk_usage() Feb 2, 2025

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

Comment thread vlib/os/os_nix.c.v Outdated
Comment thread vlib/os/os_windows.c.v Outdated
spytheman and others added 2 commits February 2, 2025 19:31
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
Co-authored-by: JalonSolov <JalonSolov@gmail.com>
@spytheman spytheman merged commit d78bf11 into vlang:master Feb 2, 2025
@kbkpbot kbkpbot deleted the os_add_disk_usage branch February 3, 2025 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants