mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
send empty files
This commit is contained in:
parent
83db5bdc68
commit
2735c42a9d
1 changed files with 7 additions and 0 deletions
|
@ -673,6 +673,13 @@ func (c *Client) updateState() (err error) {
|
||||||
fileHash, errHash := utils.HashFile(path.Join(fileInfo.FolderRemote, fileInfo.Name))
|
fileHash, errHash := utils.HashFile(path.Join(fileInfo.FolderRemote, fileInfo.Name))
|
||||||
if fileInfo.Size == 0 {
|
if fileInfo.Size == 0 {
|
||||||
log.Debugf("touching file with folder / name")
|
log.Debugf("touching file with folder / name")
|
||||||
|
emptyFile, errCreate := os.Create(path.Join(fileInfo.FolderRemote, fileInfo.Name))
|
||||||
|
if errCreate != nil {
|
||||||
|
log.Error(errCreate)
|
||||||
|
err = errCreate
|
||||||
|
return
|
||||||
|
}
|
||||||
|
emptyFile.Close()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash)
|
log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue