Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If writing a file we always want Create #1173

Merged
merged 1 commit into from Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -34,6 +34,7 @@ More detailed release notes can be found on the [releases page](https://github.c
* Empty main menu causes panic (#1073)
* Installing using `fyne install` on Linux now works on distrubutions that don't use `/usr/local`
* Fix recommendations from staticcheck
* Unable to overwrite file when using dialog.ShowFileSave (#1168)


## 1.3 - 5 June 2020
Expand Down
5 changes: 1 addition & 4 deletions internal/driver/glfw/file.go
Expand Up @@ -36,10 +36,7 @@ func openFile(uri fyne.URI, create bool) (*file, error) {
}

path := uri.String()[7:]
f, err := os.Open(path)
if err != nil && create {
f, err = os.Create(path)
}
f, err := os.Create(path) // If it exists this will truncate which is what we wanted

return &file{File: f, path: path}, err
}