idtools_windows.go 708 B

12345678910111213141516171819202122232425
  1. // +build windows
  2. package idtools
  3. import (
  4. "os"
  5. "github.com/docker/docker/pkg/system"
  6. )
  7. // Platforms such as Windows do not support the UID/GID concept. So make this
  8. // just a wrapper around system.MkdirAll.
  9. func mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error {
  10. if err := system.MkdirAll(path, mode); err != nil && !os.IsExist(err) {
  11. return err
  12. }
  13. return nil
  14. }
  15. // CanAccess takes a valid (existing) directory and a uid, gid pair and determines
  16. // if that uid, gid pair has access (execute bit) to the directory
  17. // Windows does not require/support this function, so always return true
  18. func CanAccess(path string, uid, gid int) bool {
  19. return true
  20. }