2018-06-27 09:02:49 +01:00
|
|
|
// Copyright (C) 2018 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package process
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2018-07-19 01:09:38 +01:00
|
|
|
// check if file exists, handle error correctly if it doesn't
|
2018-07-17 15:12:35 +01:00
|
|
|
func fileExists(path string) bool {
|
|
|
|
_, err := os.Stat(path)
|
|
|
|
if err != nil {
|
|
|
|
if os.IsNotExist(err) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
log.Fatalf("failed to check for file existence: %v", err)
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
}
|