Skip to content

Commit

Permalink
Changing permissions to walk the entire structure
Browse files Browse the repository at this point in the history
  • Loading branch information
deranjer committed Apr 4, 2018
1 parent aee3516 commit f69ec5b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion engine/doneTorrentActions.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ func MoveAndLeaveSymlink(config Settings.FullClientSettings, tHash string, db *s
Logger.WithFields(logrus.Fields{"Old File Path": oldFilePath, "New File Path": newFilePath, "error": err}).Error("Error Copying Folder!")
return err
}
os.Chmod(newFilePath, 0777)
//os.Chmod(newFilePath, 0777)
err = filepath.Walk(newFilePath, func(path string, info os.FileInfo, err error) error { //Walking the file path to change the permissions
if err != nil {
Logger.WithFields(logrus.Fields{"file": path, "error": err}).Error("Potentially non-critical error, continuing..")
}
os.Chmod(path, 0777)
return nil
})
/* if runtime.GOOS != "windows" { //TODO the windows symlink is broken on windows 10 creator edition, so on the other platforms create symlink (windows will copy) until Go1.11
os.RemoveAll(oldFilePath)
err = os.Symlink(newFilePath, oldFilePath)
Expand Down

0 comments on commit f69ec5b

Please sign in to comment.