如果已经有足够的硬盘写入速度测试数据,则不再执行测试

This commit is contained in:
GoEdgeLab
2024-05-02 11:49:51 +08:00
parent cb455b8a84
commit 30f2b29f64
4 changed files with 77 additions and 21 deletions

View File

@@ -54,3 +54,15 @@ func Open(name string) (f *os.File, err error) {
ReaderLimiter.Release()
return
}
// ExistFile 检查文件是否存在
func ExistFile(path string) (bool, error) {
stat, err := os.Stat(path)
if err != nil {
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
return !stat.IsDir(), nil
}