mirror of
https://gitee.com/zhangsken/aliyunpan.git
synced 2026-10-16 02:23:49 +08:00
open file with readonly mode
This commit is contained in:
@@ -87,7 +87,7 @@ func IsVideoFile(fileName string) bool {
|
|||||||
|
|
||||||
// CalcFilePreHash 计算文件 PreHash
|
// CalcFilePreHash 计算文件 PreHash
|
||||||
func CalcFilePreHash(filePath string) string {
|
func CalcFilePreHash(filePath string) string {
|
||||||
localFile, _ := os.Open(filePath)
|
localFile, _ := os.OpenFile(filePath, os.O_RDONLY, 0)
|
||||||
defer localFile.Close()
|
defer localFile.Close()
|
||||||
bytes := make([]byte, 1024)
|
bytes := make([]byte, 1024)
|
||||||
localFile.ReadAt(bytes, 0)
|
localFile.ReadAt(bytes, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user