Bring the Wails desktop shell to feature parity with the CLI for provider and alias management while keeping the browser fallback working. Wire tray, notifications, autostart, and GUI warnings so desktop flows behave predictably.
32 lines
643 B
Go
32 lines
643 B
Go
//go:build windows
|
|
|
|
package fileutil
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
func lockFile(file *os.File) error {
|
|
var overlapped windows.Overlapped
|
|
if err := windows.LockFileEx(windows.Handle(file.Fd()), windows.LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &overlapped); err != nil {
|
|
return fmt.Errorf("lock file ex: %w", err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func unlockFile(file *os.File) error {
|
|
var overlapped windows.Overlapped
|
|
if err := windows.UnlockFileEx(windows.Handle(file.Fd()), 0, 1, 0, &overlapped); err != nil {
|
|
return fmt.Errorf("unlock file ex: %w", err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func syncDir(dir string) error {
|
|
_ = dir
|
|
return nil
|
|
}
|