mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-25 00:10:25 +08:00
如果已经有足够的硬盘写入速度测试数据,则不再执行测试
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user