diff options
Diffstat (limited to 'internal/nametransform/longnames.go')
-rw-r--r-- | internal/nametransform/longnames.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/nametransform/longnames.go b/internal/nametransform/longnames.go index 7a6d413..1bbcbb6 100644 --- a/internal/nametransform/longnames.go +++ b/internal/nametransform/longnames.go @@ -69,6 +69,13 @@ func IsLongContent(cName string) bool { return NameType(cName) == LongNameContent } +// RemoveLongNameSuffix removes the ".name" suffix from cName, returning the corresponding +// content file name. +// No check is made if cName actually is a LongNameFilename. +func RemoveLongNameSuffix(cName string) string { + return cName[:len(cName)-len(LongNameSuffix)] +} + // ReadLongName - read cName + ".name" from the directory opened as dirfd. // // Symlink-safe through Openat(). |