Skip to content

Commit b1b69f1

Browse files
committed
Improve documentation for FD types
1 parent 2928a8c commit b1b69f1

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

openuri/opendir.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type OpenDirOptions struct {
1616
}
1717

1818
// OpenDirectory asks to open the directory containing a local file in the file browser.
19+
// The input parameter fd should be a file descriptor like the one given from [*os.File.Fd] for example.
1920
func OpenDirectory(parentWindow string, fd uintptr, options *OpenDirOptions) error {
2021
conn, err := dbus.SessionBus() // Shared connection, don't close.
2122
if err != nil {

openuri/openfile.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type OpenFileOptions struct {
1616
}
1717

1818
// OpenFile asks to open a local file.
19+
// The input parameter fd should be a file descriptor like the one given from [*os.File.Fd] for example.
1920
func OpenFile(parentWindow string, fd uintptr, options *OpenFileOptions) error {
2021
conn, err := dbus.SessionBus() // Shared connection, don't close.
2122
if err != nil {

openuri/openuri.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ type OpenURIOptions struct {
2121
}
2222

2323
// OpenURI opens the given URI in the corresponding application.
24+
// Note that file:// URIs are explicitly not supported by this method.
25+
// To request opening local files, use [OpenFile].
2426
func OpenURI(parentWindow, uri string, options *OpenURIOptions) error {
2527
conn, err := dbus.SessionBus() // Shared connection, don't close.
2628
if err != nil {

trash/trashfile.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const (
1717
)
1818

1919
// TrashFile sends a file to the trashcan. Applications are allowed to trash a file if they can open it in r/w mode.
20+
// The input parameter fd should be a file descriptor like the one given from [*os.File.Fd] for example.
2021
func TrashFile(fd uintptr) (TrashResult, error) {
2122
conn, err := dbus.SessionBus() // Shared connection, don't close.
2223
if err != nil {

0 commit comments

Comments
 (0)