0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 21:30:16 +02:00

send empty files

This commit is contained in:
Zack Scholl 2019-07-19 17:46:02 -07:00
parent 83db5bdc68
commit 2735c42a9d

View file

@ -673,6 +673,13 @@ func (c *Client) updateState() (err error) {
fileHash, errHash := utils.HashFile(path.Join(fileInfo.FolderRemote, fileInfo.Name))
if fileInfo.Size == 0 {
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
}
log.Debugf("%s %+x %+x %+v", fileInfo.Name, fileHash, fileInfo.Hash, errHash)