Skip to content
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

Simplified dir_info example #91

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

karl-zylinski
Copy link
Collaborator

Checklist before submitting:

  • This example has been added to .github/workflows/check.yml (for automatic testing)
  • This example compiles cleanly with flags -vet -strict-style -vet-tabs -disallow-do -warnings-as-errors
  • This example follows the core naming convention: https://github.com/odin-lang/Odin/wiki/Naming-Convention (exception can be made for ports of examples that need to match 1:1 to the original source).
  • By submitting, I understand that this example is made available under these licenses: Public Domain and Odin's BSD-3 license. Only for third-party dependencies are other licenses allowed.

@karl-zylinski karl-zylinski merged commit 3e72375 into odin-lang:master Jan 18, 2025
1 check passed
@karl-zylinski karl-zylinski deleted the files-in-dir branch January 18, 2025 01:24
if fi.is_dir {
fmt.printfln("%v (directory)", name)
} else {
fmt.printfln("%v (%v bytes)", name, fi.size)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could show of %m here which is for formatting sizes. It would nicely print 1kb for example instead of 1024 bytes.

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.

2 participants