Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qjfoidnh committed Jan 11, 2021
1 parent 93c17ee commit d03a220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions internal/pcscommand/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ type (

// RunRapidUpload 执行秒传文件, 前提是知道文件的大小, md5, 前256KB切片的 md5, crc32
func RunRapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64) {
targetPath = strings.Replace(targetPath, `[`, `\[`, -1)
targetPath = strings.Replace(targetPath, `]`, `\]`, -1)
err := matchPathByShellPatternOnce(&targetPath)
dirname := path.Dir(targetPath)
err := matchPathByShellPatternOnce(&dirname)
if err != nil {
fmt.Printf("警告: %s, 获取网盘路径 %s 错误, %s\n", baidupcs.OperationRapidUpload, targetPath, err)
fmt.Printf("警告: %s, 获取网盘路径 %s 错误, %s\n", baidupcs.OperationRapidUpload, dirname, err)
}

err = GetBaiduPCS().RapidUpload(targetPath, contentMD5, sliceMD5, crc32, length)
Expand Down
2 changes: 1 addition & 1 deletion pcsutil/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func WalkDir(dirPth, suffix string) (files []string, err error) {
if err != nil {
return err
}
if fi.IsDir() { // 忽略目录
if fi.IsDir() || fi.Size() == 0 { // 忽略目录和空文件
return nil
}
if fi.Mode()&os.ModeSymlink != 0 { // 读取 symbol link
Expand Down

0 comments on commit d03a220

Please sign in to comment.