mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
fix tabs
This commit is contained in:
+14
-14
@@ -32,10 +32,10 @@ foreign lib {
|
|||||||
defer posix.free(list)
|
defer posix.free(list)
|
||||||
|
|
||||||
entries := list[:ret]
|
entries := list[:ret]
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
log.info(entry)
|
log.info(entry)
|
||||||
posix.free(entry)
|
posix.free(entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/scandir.html ]]
|
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/scandir.html ]]
|
||||||
*/
|
*/
|
||||||
@@ -90,16 +90,16 @@ foreign lib {
|
|||||||
Returns nil when the end is reached or an error occurred (which sets errno).
|
Returns nil when the end is reached or an error occurred (which sets errno).
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
posix.set_errno(.NONE)
|
posix.set_errno(.NONE)
|
||||||
entry := posix.readdir(dirp)
|
entry := posix.readdir(dirp)
|
||||||
if entry == nil {
|
if entry == nil {
|
||||||
if errno := posix.errno(); errno != .NONE {
|
if errno := posix.errno(); errno != .NONE {
|
||||||
panic(string(posix.strerror(errno)))
|
panic(string(posix.strerror(errno)))
|
||||||
} else {
|
} else {
|
||||||
fmt.println("end of directory stream")
|
fmt.println("end of directory stream")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.println(entry)
|
fmt.println(entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html ]]
|
[[ More; https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html ]]
|
||||||
|
|||||||
Reference in New Issue
Block a user