This commit is contained in:
parent
bdfba6c96d
commit
a2d4817e15
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue