mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-07-30 04:29:05 +00:00
20 lines
320 B
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
|
|
}
|