mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer.copy: zero fileSize for directories
This commit is contained in:
parent
ed6aa13520
commit
1e76fc994a
|
@ -213,11 +213,15 @@ func genFileCopyTask(fileOrDir string, destPath string, fileCopyTaskChan chan Fi
|
||||||
|
|
||||||
mode := fi.Mode()
|
mode := fi.Mode()
|
||||||
uid, gid := util.GetFileUidGid(fi)
|
uid, gid := util.GetFileUidGid(fi)
|
||||||
|
fileSize := fi.Size()
|
||||||
|
if mode.IsDir() {
|
||||||
|
fileSize = 0
|
||||||
|
}
|
||||||
|
|
||||||
fileCopyTaskChan <- FileCopyTask{
|
fileCopyTaskChan <- FileCopyTask{
|
||||||
sourceLocation: fileOrDir,
|
sourceLocation: fileOrDir,
|
||||||
destinationUrlPath: destPath,
|
destinationUrlPath: destPath,
|
||||||
fileSize: fi.Size(),
|
fileSize: fileSize,
|
||||||
fileMode: fi.Mode(),
|
fileMode: fi.Mode(),
|
||||||
uid: uid,
|
uid: uid,
|
||||||
gid: gid,
|
gid: gid,
|
||||||
|
|
Loading…
Reference in a new issue