Lines Matching refs:Mode
49 Mode int64 // permission and mode bits
76 func (fi headerFileInfo) IsDir() bool { return fi.Mode().IsDir() }
88 // Mode returns the permission and mode bits for the headerFileInfo.
89 func (fi headerFileInfo) Mode() (mode os.FileMode) {
91 mode = os.FileMode(fi.h.Mode).Perm()
94 if fi.h.Mode&c_ISUID != 0 {
96 mode |= os.ModeSetuid
98 if fi.h.Mode&c_ISGID != 0 {
100 mode |= os.ModeSetgid
102 if fi.h.Mode&c_ISVTX != 0 {
104 mode |= os.ModeSticky
107 // Set file mode bits.
109 m := os.FileMode(fi.h.Mode) &^ 07777
112 mode |= os.ModeDir
116 mode |= os.ModeNamedPipe
120 mode |= os.ModeSymlink
124 mode |= os.ModeDevice
128 mode |= os.ModeDevice
129 mode |= os.ModeCharDevice
133 mode |= os.ModeSocket
139 mode |= os.ModeSymlink
142 mode |= os.ModeDevice
143 mode |= os.ModeCharDevice
146 mode |= os.ModeDevice
149 mode |= os.ModeDir
152 mode |= os.ModeNamedPipe
155 return mode
161 // Mode constants from the tar spec.
203 fm := fi.Mode()
207 Mode: int64(fm.Perm()), // or'd with c_IS* constants later
211 h.Mode |= c_ISREG
216 h.Mode |= c_ISDIR
220 h.Mode |= c_ISLNK
224 h.Mode |= c_ISCHR
227 h.Mode |= c_ISBLK
232 h.Mode |= c_ISFIFO
234 h.Mode |= c_ISSOCK
236 return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm)
239 h.Mode |= c_ISUID
242 h.Mode |= c_ISGID
245 h.Mode |= c_ISVTX