Standard library / archive/zip

archive/zip.FileHeader.Mode()

Translate stored external attributes to Go file mode. Expected stdout: '640\n'.

Formal Syntax & Structure

go syntaxgo
func (h *FileHeader) Mode() (mode fs.FileMode)

Return Value

(mode fs.FileMode)

File mode including type and permissions.

Working Example

Example Snippetgo
package main
import (  "archive/zip"  "fmt")
func must(e error) {  if e != nil {    panic(e)  }}
func main() { h := zip.FileHeader{}; h.SetMode(0640); fmt.Printf("%o\n", h.Mode().Perm()) }
Go Reference