gitlab.com/apertussolutions/u-root@v7.0.0+incompatible/pkg/cpio/const.go (about)

     1  // Copyright 2013-2017 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package cpio
     6  
     7  // These Unix constants are needed everywhere cpio is used, Unix or not.
     8  // But we are unable to import the unix package when plan 9 is enabled,
     9  // so lucky us, the numbers have been the same for half a century.
    10  // It is ok to just define them.
    11  const (
    12  	S_IEXEC  = 0x40
    13  	S_IFBLK  = 0x6000
    14  	S_IFCHR  = 0x2000
    15  	S_IFDIR  = 0x4000
    16  	S_IFIFO  = 0x1000
    17  	S_IFLNK  = 0xa000
    18  	S_IFMT   = 0xf000
    19  	S_IFREG  = 0x8000
    20  	S_IFSOCK = 0xc000
    21  	S_IFWHT  = 0xe000
    22  	S_IREAD  = 0x100
    23  	S_IRGRP  = 0x20
    24  	S_IROTH  = 0x4
    25  	S_IRUSR  = 0x100
    26  	S_IRWXG  = 0x38
    27  	S_IRWXO  = 0x7
    28  	S_IRWXU  = 0x1c0
    29  	S_ISGID  = 0x400
    30  	S_ISTXT  = 0x200
    31  	S_ISUID  = 0x800
    32  	S_ISVTX  = 0x200
    33  )
    34  
    35  // Unix mode_t bits.
    36  const (
    37  	modeTypeMask    = 0170000
    38  	modeSocket      = 0140000
    39  	modeSymlink     = 0120000
    40  	modeFile        = 0100000
    41  	modeBlock       = 0060000
    42  	modeDir         = 0040000
    43  	modeChar        = 0020000
    44  	modeFIFO        = 0010000
    45  	modeSUID        = 0004000
    46  	modeSGID        = 0002000
    47  	modeSticky      = 0001000
    48  	modePermissions = 0000777
    49  )