File: umask_windows_test.go

package info (click to toggle)
golang-github-codeclysm-extract 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 280 kB
  • sloc: makefile: 8
file content (21 lines) | stat: -rw-r--r-- 449 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//go:build windows

package extract_test

func UnixUmaskZero() int {
	return 0
}

func UnixUmask(userUmask int) {
}

func OsFilePerms(unixPerms uint64) uint64 {
	// Go on Windows just uses 666/444 for files depending on whether "read only" is set
	globalPerms := unixPerms >> 6
	return globalPerms | (globalPerms << 3) | (globalPerms << 6)
}

func OsDirPerms(unixPerms uint64) uint64 {
	// Go on Windows just uses 777 for directories
	return 0777
}