mirror of
https://github.com/restic/restic.git
synced 2026-05-14 22:35:23 +00:00
20 lines
692 B
Go
20 lines
692 B
Go
//go:build windows
|
|
|
|
package fs
|
|
|
|
// TODO honor flags when opening files
|
|
|
|
// O_NOFOLLOW is currently only interpreted by FS.OpenFile in metadataOnly mode and ignored by OpenFile.
|
|
// The value of the constant is invented and only for use within this fs package. It must not be used in other contexts.
|
|
// It must not conflict with the other O_* values from go/src/syscall/types_windows.go
|
|
const O_NOFOLLOW int = 0x40000000
|
|
|
|
// O_DIRECTORY is a noop on Windows.
|
|
const O_DIRECTORY int = 0
|
|
|
|
// sanitizeFlags cleans up flags that conflict with actual OS API flags
|
|
// Must only be used right before passing the flags to the go stdlib.
|
|
func sanitizeFlags(flags int) int {
|
|
return flags &^ O_NOFOLLOW
|
|
}
|