As a continuation of this question , I am trying to write a Go program that only lists the file name in an effective question without unnecessary system calls. This is what I have so far:
package main
import (
"os"
"fmt"
"log"
)
func main() {
f, err := os.Open(".")
if err != nil {
log.Fatal(err)
}
files, err := f.Readdirnames(0)
if err != nil {
log.Fatal(err)
}
fmt.Print(files, "\n")
}
However, when I run strace, I see a lot of the following:
clock_gettime(CLOCK_REALTIME, {1406822401, 824793686}) = 0
What does it mean? How can I make this code more efficient?
source
share