2021-03-11 19:39:30 +00:00
|
|
|
// +build windows
|
2021-04-03 11:39:04 +00:00
|
|
|
// +build !noselfupdate
|
2021-03-11 19:39:30 +00:00
|
|
|
|
|
|
|
package selfupdate
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
func writable(path string) bool {
|
|
|
|
info, err := os.Stat(path)
|
|
|
|
const UserWritableBit = 128
|
|
|
|
if err == nil {
|
|
|
|
return info.Mode().Perm()&UserWritableBit != 0
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|