mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
30 lines
657 B
Go
30 lines
657 B
Go
// Copyright (C) 2016 The Syncthing Authors.
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
// You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
// +build !windows
|
|
|
|
package fs
|
|
|
|
import "os"
|
|
|
|
var symlinksSupported = true
|
|
|
|
func DisableSymlinks() {
|
|
symlinksSupported = false
|
|
}
|
|
|
|
func (BasicFilesystem) SymlinksSupported() bool {
|
|
return symlinksSupported
|
|
}
|
|
|
|
func (BasicFilesystem) CreateSymlink(name, target string) error {
|
|
return os.Symlink(target, name)
|
|
}
|
|
|
|
func (BasicFilesystem) ReadSymlink(path string) (string, error) {
|
|
return os.Readlink(path)
|
|
}
|