/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
pkg/fs/case.go
30 строк
654 B
Michael Mayer
Backend: Clean up error handling and unit tests in pkg/...
09 фев 2026, 14:31
09 фев 2026, 14:31
df5efb6
Код
Авторство
О чём код?
package fs import ( "fmt" "os" "path/filepath" ) // CaseInsensitive tests if a storage path is case-insensitive. func CaseInsensitive(storagePath string) (result bool, err error) { tmpName := filepath.Join(storagePath, ".caseTest.tmp") if err = os.WriteFile(tmpName, []byte("{}"), ModeFile); err != nil { return false, fmt.Errorf("%s not writable", filepath.Base(storagePath)) } defer func() { _ = os.Remove(tmpName) }() result = FileExists(filepath.Join(storagePath, ".CASETEST.TMP")) return result, err } // IgnoreCase enables the case-insensitive mode. func IgnoreCase() { ignoreCase = true FileTypes = Extensions.Types(true) }