mirror of https://github.com/schollz/croc.git
don't create folder if its a .
This commit is contained in:
parent
e3ed4ba998
commit
ae384490d6
|
@ -894,8 +894,11 @@ func (c *Client) recipientInitializeFile() (err error) {
|
|||
c.FilesToTransfer[c.FilesToTransferCurrentNum].Name,
|
||||
)
|
||||
folderForFile, _ := filepath.Split(pathToFile)
|
||||
if err := os.MkdirAll(folderForFile, os.ModePerm); err != nil {
|
||||
log.Errorf("can't create %s: %v", folderForFile, err)
|
||||
folderForFileBase := filepath.Base(folderForFile)
|
||||
if folderForFileBase != "." && folderForFileBase != "" {
|
||||
if err := os.MkdirAll(folderForFile, os.ModePerm); err != nil {
|
||||
log.Errorf("can't create %s: %v", folderForFile, err)
|
||||
}
|
||||
}
|
||||
var errOpen error
|
||||
c.CurrentFile, errOpen = os.OpenFile(
|
||||
|
|
Loading…
Reference in New Issue