// Mode implements the os.FileInfo interface for FileInfo.
486291
func (fi *FileInfo) Mode() os.FileMode {
	mode, err := WritePermMode(
		fi.fs.ctx, fi.node, os.FileMode(0), fi.fs.config.KBPKI(),
		fi.fs.config, fi.fs.h)
	if err != nil {
		fi.fs.log.CWarningf(
			fi.fs.ctx, "Couldn't get mode for file %s: %+v", fi.Name(), err)
		mode = os.FileMode(0)
	}

	mode |= 0400
	switch fi.ei.Type {
	case data.Dir:
		mode |= os.ModeDir | 0100
	case data.Sym:
		mode |= os.ModeSymlink
	case data.Exec:
		mode |= 0100
	}
	return mode
}
852361
func GetFileModeOfFile(pth string) (os.FileMode, error) {
	finfo, err := os.Lstat(pth)
	if err != nil {
		return 0, err
	}
	return finfo.Mode(), nil
}
311497
func (q *SearchSortField) Mode(mode string) *SearchSortField {
	q.options["mode"] = mode
	return q
}
437972
func (n *PodNetwork) SetMode(mode PodNetworkMode) *PodNetwork {
	n.Mode = mode
	return n
}
954908
func (n *NetworkOpt) NetworkMode() string {
	networkIDOrName := "default"
	netOptVal := n.Value()
	if len(netOptVal) > 0 {
		networkIDOrName = netOptVal[0].Target
	}
	return networkIDOrName
}
926650
func (c *ConfigLocal) Mode() InitMode {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.mode
}
1342605
func (env *Env) Open(path string, flags uint, mode os.FileMode) error {
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))
	ret := C.mdb_env_open(env._env, cpath, C.uint(NoTLS|flags), C.mdb_mode_t(mode))
	return operrno("mdb_env_open", ret)
}
127528
func (fs *FS) Chmod(name string, mode os.FileMode) (err error) {
	fs.log.CDebugf(fs.ctx, "Chmod %s %s", name, mode)
	defer func() {
		fs.deferLog.CDebugf(fs.ctx, "Chmod done: %+v", err)
		err = translateErr(err)
	}()

	if err := fs.requireNonEmpty(); err != nil {
		return err
	}

	n, _, err := fs.lookupOrCreateEntry(name, os.O_RDONLY, 0)
	if err != nil {
		return err
	}

	isExec := (mode & 0100) != 0
	return fs.config.KBFSOps().SetEx(fs.ctx, n, isExec)
}
353710
func (s *FieldSort) SortMode(sortMode string) *FieldSort {
	s.sortMode = &sortMode
	return s
}
12044
func (fn *LinearDecayFunction) MultiValueMode(mode string) *LinearDecayFunction {
	fn.multiValueMode = mode
	return fn
}
42119
func (OSFileSystem) Stat(name string) (os.FileInfo, error) {
	return os.Stat(name)
}
669415
func (m FileMode) Bytes() []byte {
	ret := make([]byte, 4)
	binary.LittleEndian.PutUint32(ret, uint32(m))
	return ret[:]
}
1152659
func (o *Config) getMode() (os.FileMode, bool, error) {
	modeOverride := o.OutMode != ""
	m, err := strconv.ParseUint("0"+o.OutMode, 8, 32)
	if err != nil {
		return 0, false, err
	}
	mode := os.FileMode(m)
	if mode == 0 && o.Input != "" {
		mode = 0644
	}
	return mode, modeOverride, nil
}
406361
func ParseFileMode(s string) (FileMode, error) {
	var fm FileMode
	if err := fm.UnmarshalText([]byte(s)); err != nil {
		return 0, err
	}
	return fm, nil
}
1118272
func (s *DB) LogMode(enable bool) *DB {
	if enable {
		s.logMode = detailedLogMode
	} else {
		s.logMode = noLogMode
	}
	return s
}
994180
func (fi headerFileInfo) Mode() (mode os.FileMode) {
	// Set file permission bits.
	mode = os.FileMode(fi.h.Mode).Perm()
	return mode
}
509557
func (n *Mounter) GetMode(pathname string) (os.FileMode, error) {
	hostPath, err := n.ne.EvalSymlinks(pathname, true /* mustExist */)
	if err != nil {
		return 0, err
	}
	kubeletpath := n.ne.KubeletPath(hostPath)
	return mount.GetModeLinux(kubeletpath)
}