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

os.ls (using readdir) doc and example #20622

Merged
merged 8 commits into from
Jan 21, 2024
Merged

Conversation

scriptmaster
Copy link
Contributor

os.ls (using readdir) doc and example

// ls returns ![]string of the files and folders in the given path ( os.ls uses C.readdir ). It includes symbolic links. See also: os.is_dir, os.is_file
// Example: https://github.com/vlang/v/blob/master/examples/readdir.v
// // entries := os.ls(os.home_dir()) or { [] } // for entry in entries { // if os.is_dir(os.join_path(os.home_dir(), entry)) { // println('dir: $entry') // } else { // println('file: $entry') // } // } //
pub fn ls(path string) ![]string {

doc/docs.md Outdated Show resolved Hide resolved
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent work.

@JalonSolov
Copy link
Contributor

Need to run v fmt -w . in your playpen, and push the changed files.

vlib/os/os.v Outdated Show resolved Hide resolved
vlib/os/os.v Outdated Show resolved Hide resolved
@scriptmaster
Copy link
Contributor Author

v fmt on example done
v check on docs done
wordings about restart and see updated.

@spytheman spytheman merged commit ea2d92d into vlang:master Jan 21, 2024
47 of 48 checks passed
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.

None yet

3 participants