mirror of
https://github.com/vbatts/srvdav.git
synced 2025-02-18 01:57:55 +00:00
31 lines
484 B
Go
31 lines
484 B
Go
|
package files
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
"path/filepath"
|
||
|
"github.com/samedi/caldav-go/lib"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
Separator = string(filepath.Separator)
|
||
|
)
|
||
|
|
||
|
func AbsPath(path string) string {
|
||
|
path = strings.Trim(path, "/")
|
||
|
absPath, _ := filepath.Abs(path)
|
||
|
|
||
|
return absPath
|
||
|
}
|
||
|
|
||
|
func DirPath(path string) string {
|
||
|
return filepath.Dir(path)
|
||
|
}
|
||
|
|
||
|
func JoinPaths(paths ...string) string {
|
||
|
return filepath.Join(paths...)
|
||
|
}
|
||
|
|
||
|
func ToSlashPath(path string) string {
|
||
|
return lib.ToSlashPath(path)
|
||
|
}
|