// Stat returns the size of the object and its last modification time
17828
func (ioctx *IOContext) Stat(object string) (stat ObjectStat, err error) {
	var c_psize C.uint64_t
	var c_pmtime C.time_t
	c_object := C.CString(object)
	defer C.free(unsafe.Pointer(c_object))

	ret := C.rados_stat(
		ioctx.ioctx,
		c_object,
		&c_psize,
		&c_pmtime)

	if ret < 0 {
		return ObjectStat{}, GetRadosError(int(ret))
	} else {
		return ObjectStat{
			Size:    uint64(c_psize),
			ModTime: time.Unix(int64(c_pmtime), 0),
		}, nil
	}
}
490930
func (DefaultFs) Stat(name string) (os.FileInfo, error) {
	return os.Stat(name)
}
1222987
func (fs *MemFS) Stat(name string) (os.FileInfo, error) {
	fs.lock.RLock()
	defer fs.lock.RUnlock()

	name = filepath.Clean(name)
	// dir, base := filepath.Split(name)
	_, fi, err := fs.fileInfo(name)
	if err != nil {
		return nil, &os.PathError{"stat", name, err}
	}
	if fi == nil {
		return nil, &os.PathError{"stat", name, os.ErrNotExist}
	}
	return fi, nil
}
1024921
func Stat(fs http.FileSystem, name string) (os.FileInfo, error) {
	f, err := fs.Open(name)
	if err != nil {
		return nil, err
	}
	defer f.Close()
	return f.Stat()
}
890707
func (a *AtomicFS) Stat(ctx context.Context, path string) (os.FileInfo, error) {
	fs := a.v.Load().(ctxvfs.NameSpace)
	return fs.Stat(ctx, path)
}
787145
func (ns *Namespace) Stat(i interface{}) (_os.FileInfo, error) {
	path, err := cast.ToStringE(i)
	if err != nil {
		return nil, err
	}

	if path == "" {
		return nil, errors.New("fileStat needs a path to a file")
	}

	r, err := ns.readFileFs.Stat(path)
	if err != nil {
		return nil, err
	}

	return r, nil
}
775734
func (s *DriveService) Stat(ctx context.Context, title string) (int64, error) {
	file, err := s.Get(ctx, title)
	if err != nil || file == nil {
		return 0, err
	}
	return file.FileSize, err
}
513370
func (m *ProcessManager) Stat(u *url.URL) (os.FileInfo, error) {
	name := path.Join("/proc", u.Path)

	info, err := os.Stat(name)
	if err == nil && info.Size() == 0 {
		// This is a real /proc file
		return &procFileInfo{info}, nil
	}

	dir, file := path.Split(u.Path)

	pid, err := strconv.ParseInt(path.Base(dir), 10, 64)
	if err != nil {
		return nil, os.ErrNotExist
	}

	m.mu.Lock()
	p := m.entries[pid]
	m.mu.Unlock()

	if p == nil || p.IO == nil {
		return nil, os.ErrNotExist
	}

	pf := &ProcessFile{
		name:   name,
		Closer: ioutil.NopCloser(nil), // via hgfs, nop for stdout and stderr
	}

	var r *bytes.Buffer

	switch file {
	case "stdin":
		pf.Writer = p.IO.In.Writer
		pf.Closer = p.IO.In.Closer
		return pf, nil
	case "stdout":
		r = p.IO.Out
	case "stderr":
		r = p.IO.Err
	default:
		return nil, os.ErrNotExist
	}

	select {
	case <-p.ctx.Done():
	case <-time.After(time.Second):
		// The vmx guest RPC calls are queue based, serialized on the vmx side.
		// There are 5 seconds between "ping" RPC calls and after a few misses,
		// the vmx considers tools as not running.  In this case, the vmx would timeout
		// a file transfer after 60 seconds.
		//
		// vix.FileAccessError is converted to a CannotAccessFile fault,
		// so the client can choose to retry the transfer in this case.
		// Would have preferred vix.ObjectIsBusy (EBUSY), but VC/ESX converts that
		// to a general SystemErrorFault with nothing but a localized string message
		// to check against: "<reason>vix error codes = (5, 0).</reason>"
		// Is standard vmware-tools, EACCES is converted to a CannotAccessFile fault.
		return nil, vix.Error(vix.FileAccessError)
	}

	pf.Reader = r
	pf.size = r.Len()

	return pf, nil
}
320498
func (b *BasePathRealFilenameFs) Stat(name string) (os.FileInfo, error) {
	fi, err := b.BasePathFs.Stat(name)
	if err != nil {
		return nil, err
	}

	if _, ok := fi.(RealFilenameInfo); ok {
		return fi, nil
	}

	filename, err := b.RealPath(name)
	if err != nil {
		return nil, &os.PathError{Op: "stat", Path: name, Err: err}
	}

	return &realFilenameInfo{FileInfo: fi, realFilename: filename}, nil
}
1329440
func (c *Client) Stat(name string) (os.FileInfo, error) {
	out, err := c.Files.GetMetadata(&dropbox.GetMetadataInput{
		Path: name,
	})

	if err != nil {
		return nil, err
	}

	return &FileInfo{&out.Metadata}, nil
}
113677
func (db *Database) Stat(property string) (string, error) {
	return db.db.GetProperty(property)
}
654271
func (fs *RootMappingFs) Stat(name string) (os.FileInfo, error) {
	if fs.isRoot(name) {
		return newRootMappingDirFileInfo(name), nil
	}
	realName := fs.realName(name)

	fi, err := fs.Fs.Stat(realName)
	if rfi, ok := fi.(RealFilenameInfo); ok {
		return rfi, err
	}

	return &realFilenameInfo{FileInfo: fi, realFilename: realName}, err

}
250977
func (f *File) Stat() (os.FileInfo, error) {
	if f.appendedF != nil {
		if f.appendedF.dir {
			return f.appendedF.dirInfo, nil
		}
		if f.appendedFileReader == nil {
			return nil, errors.New("file is closed")
		}
		return f.appendedF.zipFile.FileInfo(), nil
	}
	if f.virtualF != nil {
		return f.virtualF.stat()
	}
	if f.virtualD != nil {
		return f.virtualD.stat()
	}
	return f.realF.Stat()
}
1087365
func (a *ReqLatencyCounter) Stats(dimensions map[string]string) []*datapoint.Datapoint {
	now := a.timeKeeper.Now()
	getDp := func(key string, value int64) *datapoint.Datapoint {
		return datapoint.New(
			"ReqLatencyCounter.requestCounts", appendDimensions(dimensions, "requestClass", key),
			datapoint.NewIntValue(value), datapoint.Counter, now)
	}
	return []*datapoint.Datapoint{
		getDp("fast", a.fastRequests),
		getDp("slow", a.slowRequests),
	}
}
1259515
func (p *ConnPool) Stat() (s ConnPoolStat) {
	p.cond.L.Lock()
	defer p.cond.L.Unlock()

	s.MaxConnections = p.maxConnections
	s.CurrentConnections = len(p.allConnections)
	s.AvailableConnections = len(p.availableConnections)
	return
}
569863
func (ff FakeFilesystem) Stat(name string) (os.FileInfo, error) {
	file, ok := ff.files[name]
	if !ok {
		return FakeFileInfo{}, &os.PathError{Op: "stat", Path: name, Err: ErrFileDoesNotExist}
	}

	return file.Stat()
}
429250
func (c *Client) Stat(p string) (os.FileInfo, error) {
	id := c.nextID()
	typ, data, err := c.sendPacket(sshFxpStatPacket{
		ID:   id,
		Path: p,
	})
	if err != nil {
		return nil, err
	}
	switch typ {
	case ssh_FXP_ATTRS:
		sid, data := unmarshalUint32(data)
		if sid != id {
			return nil, &unexpectedIDErr{id, sid}
		}
		attr, _ := unmarshalAttrs(data)
		return fileInfoFromStat(attr, path.Base(p)), nil
	case ssh_FXP_STATUS:
		return nil, normaliseError(unmarshalStatus(id, data))
	default:
		return nil, unimplementedPacketErr(typ)
	}
}