2017-02-04 20:21:17 +00:00
|
|
|
package acme
|
|
|
|
|
2018-03-05 19:54:04 +00:00
|
|
|
import "os"
|
|
|
|
|
|
|
|
// Check file content size
|
2017-02-04 20:21:17 +00:00
|
|
|
// Do not check file permissions on Windows right now
|
2018-03-05 19:54:04 +00:00
|
|
|
func checkFile(name string) (bool, error) {
|
|
|
|
f, err := os.Open(name)
|
|
|
|
if err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
defer f.Close()
|
|
|
|
|
|
|
|
fi, err := f.Stat()
|
|
|
|
if err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return fi.Size() > 0, nil
|
2017-02-04 20:21:17 +00:00
|
|
|
}
|