mirror of
https://github.com/kopia/kopia.git
synced 2026-05-11 16:25:13 -04:00
17 lines
440 B
Go
17 lines
440 B
Go
package restore
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/kopia/kopia/fs/localfs"
|
|
)
|
|
|
|
// MaxFilenameLength is set for compatibility with Linux and MacOS.
|
|
const MaxFilenameLength = 255
|
|
|
|
// SafelySuffixablePath returns true if path can be suffixed with the
|
|
// placeholder suffix and written to the filesystem.
|
|
func SafelySuffixablePath(path string) bool {
|
|
return len(filepath.Base(path))+len(localfs.ShallowEntrySuffix) <= MaxFilenameLength
|
|
}
|