basicfs_symlink_unix.go 657 B

1234567891011121314151617181920212223242526272829
  1. // Copyright (C) 2016 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. // +build !windows
  7. package fs
  8. import "os"
  9. var symlinksSupported = true
  10. func DisableSymlinks() {
  11. symlinksSupported = false
  12. }
  13. func (BasicFilesystem) SymlinksSupported() bool {
  14. return symlinksSupported
  15. }
  16. func (BasicFilesystem) CreateSymlink(name, target string) error {
  17. return os.Symlink(target, name)
  18. }
  19. func (BasicFilesystem) ReadSymlink(path string) (string, error) {
  20. return os.Readlink(path)
  21. }