mirror of
https://github.com/derfenix/photocatalog.git
synced 2026-03-12 07:40:29 +03:00
22 lines
311 B
Go
22 lines
311 B
Go
package modes
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
type SymLink struct {
|
|
}
|
|
|
|
func (s SymLink) PlaceIt(sourcePath, targetPath string, _ os.FileMode) error {
|
|
if err := os.Symlink(sourcePath, targetPath); err != nil {
|
|
if os.IsExist(err) {
|
|
return nil
|
|
}
|
|
|
|
return fmt.Errorf("create symlink: %w", err)
|
|
}
|
|
|
|
return nil
|
|
}
|