github.com/mutagen-io/mutagen@v0.18.0-rc1/pkg/filesystem/mode_posix.go (about)

     1  //go:build !windows
     2  
     3  package filesystem
     4  
     5  import (
     6  	"golang.org/x/sys/unix"
     7  )
     8  
     9  // Mode is an opaque type representing a file mode. It is guaranteed to be
    10  // convertable to a uint32 value. On POSIX sytems, it is the raw underlying file
    11  // mode from the Stat_t structure (as opposed to the os package's FileMode
    12  // implementation).
    13  type Mode uint32
    14  
    15  const (
    16  	// ModeTypeMask is a bit mask that isolates type information. After masking,
    17  	// the resulting value can be compared with any of the ModeType* values
    18  	// (other than ModeTypeMask).
    19  	ModeTypeMask = Mode(unix.S_IFMT)
    20  	// ModeTypeDirectory represents a directory.
    21  	ModeTypeDirectory = Mode(unix.S_IFDIR)
    22  	// ModeTypeFile represents a file.
    23  	ModeTypeFile = Mode(unix.S_IFREG)
    24  	// ModeTypeSymbolicLink represents a symbolic link.
    25  	ModeTypeSymbolicLink = Mode(unix.S_IFLNK)
    26  )