mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: add web_crawler and get_weather (#10084)
This commit is contained in:
18
examples/file_list.v
Normal file
18
examples/file_list.v
Normal file
@ -0,0 +1,18 @@
|
||||
import os
|
||||
|
||||
fn main() {
|
||||
files := os.ls('.') or {
|
||||
println(err)
|
||||
return
|
||||
}
|
||||
mut f := os.create('file_list.txt') or {
|
||||
println(err)
|
||||
return
|
||||
}
|
||||
for file in files {
|
||||
if os.is_file(file) {
|
||||
f.write_string(file + '\r\n') or { println(err) }
|
||||
}
|
||||
}
|
||||
f.close()
|
||||
}
|
Reference in New Issue
Block a user