//go:build unix || (js && wasm) || wasip1 package fs 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 }