This commit is contained in:
Liang Ding 2014-11-24 10:48:37 +08:00
parent bdfba6c96d
commit a2d4817e15
1 changed files with 1 additions and 6 deletions

View File

@ -14,12 +14,7 @@ var File = myfile{}
// GetFileSize get the length in bytes of file of the specified path. // GetFileSize get the length in bytes of file of the specified path.
func (*myfile) GetFileSize(path string) int64 { func (*myfile) GetFileSize(path string) int64 {
f, err := os.Open(path) fi, err := os.Stat(path)
if nil != err {
return -1
}
fi, err := f.Stat()
if nil != err { if nil != err {
return -1 return -1
} }