1
mirror of https://github.com/rclone/rclone synced 2024-12-18 07:45:55 +01:00
rclone/cmd/selfupdate/writable_windows.go

18 lines
283 B
Go
Raw Normal View History

2021-09-09 14:25:25 +02:00
//go:build windows && !noselfupdate
// +build windows,!noselfupdate
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
}