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.
|
package main |
|
|
|
import ( |
|
"fmt" |
|
"os" |
|
|
|
"golang.org/x/sys/unix" |
|
) |
|
|
|
func main() { |
|
if len(os.Args) != 2 { |
|
fmt.Fprintf(os.Stderr, "usage: access <path>\n") |
|
os.Exit(1) |
|
} |
|
|
|
filename := os.Args[1] |
|
if err := unix.Access(filename, unix.W_OK); err != nil { |
|
fmt.Printf("%v: %v\n", filename, err) |
|
} |
|
}
|
|
|