No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.go 298B

1234567891011121314151617181920
  1. package main
  2. import (
  3. "fmt"
  4. "os"
  5. "golang.org/x/sys/unix"
  6. )
  7. func main() {
  8. if len(os.Args) != 2 {
  9. fmt.Fprintf(os.Stderr, "usage: access <path>\n")
  10. os.Exit(1)
  11. }
  12. filename := os.Args[1]
  13. if err := unix.Access(filename, unix.W_OK); err != nil {
  14. fmt.Printf("%v: %v\n", filename, err)
  15. }
  16. }