open file with readonly mode

This commit is contained in:
tickstep
2025-08-11 11:17:20 +08:00
parent 8913597716
commit 70c14fd66f
+1 -1
View File
@@ -87,7 +87,7 @@ func IsVideoFile(fileName string) bool {
// CalcFilePreHash 计算文件 PreHash
func CalcFilePreHash(filePath string) string {
localFile, _ := os.Open(filePath)
localFile, _ := os.OpenFile(filePath, os.O_RDONLY, 0)
defer localFile.Close()
bytes := make([]byte, 1024)
localFile.ReadAt(bytes, 0)