client io architecture

This commit is contained in:
Ilia Denisov
2026-03-12 18:45:46 +02:00
committed by GitHub
parent 2dafa69b93
commit 079b9facb0
36 changed files with 1810 additions and 460 deletions
+15
View File
@@ -0,0 +1,15 @@
//go:build unix || (js && wasm) || wasip1
package util
import "golang.org/x/sys/unix"
// Writable reports whether path is Writable on Windows.
//
// Semantics:
// - for an existing regular file, it tries to open it for writing;
// - for an existing directory, it tries to create and remove a temp file inside it;
// - for other file types, it returns false with no error.
func Writable(filepath string) (bool, error) {
return unix.Access(filepath, unix.W_OK) == nil, nil
}