mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
18 lines
267 B
Go
18 lines
267 B
Go
// +build !windows
|
|
|
|
// Functions shared between linux/darwin.
|
|
package allocdir
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
func (d *AllocDir) linkOrCopy(src, dst string) error {
|
|
// Attempt to hardlink.
|
|
if err := os.Link(src, dst); err == nil {
|
|
return nil
|
|
}
|
|
|
|
return fileCopy(src, dst)
|
|
}
|