driver_windows.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //go:build go1.13
  2. // +build go1.13
  3. /*
  4. Copyright The containerd Authors.
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. */
  15. // Go 1.13 is the minimally supported version for Windows.
  16. // Earlier golang releases have bug in os.Readlink
  17. // (see https://github.com/golang/go/issues/30463).
  18. package driver
  19. import (
  20. "os"
  21. )
  22. func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error {
  23. return &os.PathError{Op: "mknod", Path: path, Err: ErrNotSupported}
  24. }
  25. func (d *driver) Mkfifo(path string, mode os.FileMode) error {
  26. return &os.PathError{Op: "mkfifo", Path: path, Err: ErrNotSupported}
  27. }
  28. // Lchmod changes the mode of an file not following symlinks.
  29. func (d *driver) Lchmod(path string, mode os.FileMode) (err error) {
  30. // TODO: Use Window's equivalent
  31. return os.Chmod(path, mode)
  32. }