Standard library / io/fs

fs.ModePerm

Mask for the nine Unix permission bits; excludes file types and special bits. Expected stdout: '0644\n'.

Formal Syntax & Structure

go syntaxgo
const ModePerm FileMode = 511

Working Example

Example Snippetgo
package main
import (  "fmt"  "io/fs")
func main() { fmt.Printf("%#o\n", (fs.ModeDir|0644)&fs.ModePerm) }
Go Reference