Documentation ¶
Overview ¶
Package osutil contains utilities for functions requiring system calls and other OS-specific APIs. OS-specific network handling should go to github.com/AdguardTeam/golibs/netutil instead.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RootDirFS ¶
RootDirFS returns a filesystem rooted at the system's root directory.
Example ¶
package main import ( "fmt" "github.com/Potterli20/golibs-fork/osutil" ) func main() { fsys := osutil.RootDirFS() d, err := fsys.Open(".") if err != nil { fmt.Printf("opening: %v\n", err) return } fi, err := d.Stat() if err != nil { fmt.Printf("getting info: %v\n", err) return } fmt.Printf("is dir: %t\n", fi.IsDir()) err = d.Close() if err != nil { fmt.Printf("closing: %v\n", err) return } }
Output: is dir: true
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.