Discovered abnormal information while using FileDialog
xiongqiubo opened this issue · comments
Checklist
- I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
- This issue only relates to a single bug. I will open new issues for any other problems.
Describe the bug
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
2024/03/26 11:34:44 Fyne error: Error getting file attributes
2024/03/26 11:34:44 Cause: The process cannot access the file because it is being used by another process.
2024/03/26 11:34:44 At: C:/Users/xxx/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/dialog/file_windows.go:78
How to reproduce
After clicking to open, an error message is triggered when clicking on any root directory
Screenshots
Example code
package main
import (
"fmt"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/widget"
)
func main() {
myApp := app.New()
myWindow := myApp.NewWindow("file dialog")
myWindow.SetContent(container.NewVBox(
widget.NewButton("open", func() {
dialog.NewFileOpen(func(uc fyne.URIReadCloser, err error) {
fmt.Println("uc")
}, myWindow).Show()
}),
))
myWindow.ShowAndRun()
}
Fyne version
2.4.4
Go compiler version
go version go1.22.1 windows/amd64
Operating system and version
Windows 10
Additional Information
No response
This looks like a duplicate of #2838.
FYI the error happens at call to syscall.GetFileAttributes
which seems to be returning an error for one of the files in your C: drive like the linked issue.