1
Fork 0
photoview/api/scanner/scanner_utils/file_utils.go

20 lines
320 B
Go

package scanner_utils
import (
"log"
"os"
)
func FileExists(testPath string) bool {
_, err := os.Stat(testPath)
if os.IsNotExist(err) {
return false
} else if err != nil {
// unexpected error logging
log.Printf("Error: checking for file existence (%s): %s", testPath, err)
return false
}
return true
}