Retrieves information about the file entry.

    Returns:
      VFSStat: a stat object.
187546
def _GetStat(self):
    
    stat_object = super(VShadowFileEntry, self)._GetStat()

    if self._vshadow_store is not None:
      # File data stat information.
      stat_object.size = self._vshadow_store.volume_size

    # Ownership and permissions stat information.

    # File entry type stat information.

    # The root file entry is virtual and should have type directory.
    return stat_object
416940
def stat(self, path=None, client_kwargs=None, header=None):
        
        # Should contain at least the strict minimum of os.stat_result
        stat = OrderedDict((
            ("st_mode", 0), ("st_ino", 0), ("st_dev", 0), ("st_nlink", 0),
            ("st_uid", 0), ("st_gid", 0), ("st_size", 0), ("st_atime", 0),
            ("st_mtime", 0), ("st_ctime", 0)))

        # Populate standard os.stat_result values with object header content
        header = self.head(path, client_kwargs, header)
        for key, method in (
                ('st_size', self._getsize_from_header),
                ('st_ctime', self._getctime_from_header),
                ('st_mtime', self._getmtime_from_header),):
            try:
                stat[key] = int(method(header))
            except UnsupportedOperation:
                continue

        # File mode
        if self.islink(path=path, header=header):
            # Symlink
            stat['st_mode'] = S_IFLNK
        elif ((not path or path[-1] == '/' or self.is_locator(path)) and not
                stat['st_size']):
            # Directory
            stat['st_mode'] = S_IFDIR
        else:
            # File
            stat['st_mode'] = S_IFREG

        # Add storage specific keys
        sub = self._CHAR_FILTER.sub
        for key, value in tuple(header.items()):
            stat['st_' + sub('', key.lower())] = value

        # Convert to "os.stat_result" like object
        stat_result = namedtuple('stat_result', tuple(stat))
        stat_result.__name__ = 'os.stat_result'
        stat_result.__module__ = 'pycosio'
        return stat_result(**stat)
571756
def _GetStat(self):
    
    stat_object = super(SQLiteBlobFileEntry, self)._GetStat()

    if not self._is_virtual:
      file_object = self.GetFileObject()
      if not file_object:
        raise errors.BackEndError(
            'Unable to retrieve SQLite blob file-like object.')

      try:
        stat_object.size = file_object.get_size()
      finally:
        file_object.close()

    return stat_object
1058452
def GetLinkedFileEntry(self):
    
    link = self._GetLink()
    if not link:
      return None

    path_spec = os_path_spec.OSPathSpec(location=link)
    return OSFileEntry(self._resolver_context, self._file_system, path_spec)
1275730
def lstat(self):
        
        if self._closed:
            self._raise_closed()
        return self._accessor.lstat(self)
175897
def info(self):
        
        output = '{type}\nFile path: {path}\n'.format(
            type=type(self), path=pprint_thing(self._path))
        if self.is_open:
            lkeys = sorted(list(self.keys()))
            if len(lkeys):
                keys = []
                values = []

                for k in lkeys:
                    try:
                        s = self.get_storer(k)
                        if s is not None:
                            keys.append(pprint_thing(s.pathname or k))
                            values.append(
                                pprint_thing(s or 'invalid_HDFStore node'))
                    except Exception as detail:
                        keys.append(k)
                        values.append(
                            "[invalid_HDFStore node: {detail}]".format(
                                detail=pprint_thing(detail)))

                output += adjoin(12, keys, values)
            else:
                output += 'Empty'
        else:
            output += "File is CLOSED"

        return output
1334398
def size(self):
        ''''''
        try:
            return os.fstat(self.file.fileno()).st_size
        except io.UnsupportedOperation:
            pass

        if is_seekable(self.file):
            with wpull.util.reset_file_offset(self.file):
                self.file.seek(0, os.SEEK_END)
                return self.file.tell()

        raise OSError('Unsupported operation.')
961947
def get(self):
        
        res = self.fs.get_filesystem_details()
        res = res.to_dict()
        self.write(res)
660447
def dump_stats(filename):
    # type: (str) -> None
    
    res = _dump_impl()
    f = open(filename, 'w')
    json.dump(res, f, indent=4)
    f.close()
70463
def statvfs(path):
    '''
    
    '''
    path = os.path.expanduser(path)

    if not os.path.isabs(path):
        raise SaltInvocationError('File path must be absolute.')

    try:
        stv = os.statvfs(path)
        return dict((key, getattr(stv, key)) for key in ('f_bavail', 'f_bfree',
            'f_blocks', 'f_bsize', 'f_favail', 'f_ffree', 'f_files', 'f_flag',
            'f_frsize', 'f_namemax'))
    except (OSError, IOError):
        raise CommandExecutionError('Could not statvfs \'{0}\''.format(path))
    return False
1150696
def _GetLink(self):
    
    if self._link is None:
      self._link = ''
      if self.entry_type != definitions.FILE_ENTRY_TYPE_LINK:
        return self._link

      link = self._fsapfs_file_entry.symbolic_link_target
      if link and link[0] != self._file_system.PATH_SEPARATOR:
        # TODO: make link absolute.
        self._link = '/{0:s}'.format(link)

    return self._link
1090266
def getLoadAvg(self):
        
        try:
            fp = open(loadavgFile, 'r')
            line = fp.readline()
            fp.close()
        except:
            raise IOError('Failed reading stats from file: %s' % loadavgFile)
        arr = line.split()
        if len(arr) >= 3:
            return [float(col) for col in arr[:3]]
        else:
            return None
861958
def getSwapStats(self):
        
        info_dict = {}
        try:
            fp = open(swapsFile, 'r')
            data = fp.read()
            fp.close()
        except:
            raise IOError('Failed reading stats from file: %s' % swapsFile)
        lines = data.splitlines()
        if len(lines) > 1:
            colnames = [name.lower() for name in lines[0].split()]
            for line in lines[1:]:
                cols = line.split()
                info_dict[cols[0]] = dict(zip(colnames[1:], cols[1:]))
        return info_dict
867453
function getFileInfo (fileName) {
    var result = {};
    result.name = fileName;
    result.exists = fs.existsSync (fileName);
    if (result.exists) {
        var stats = fs.statSync (fileName);
        result.isFile = stats.isFile ();
        result.isDirectory = stats.isDirectory ();
    }
    else {
        result.isFile = false;
        result.isDirectory = false;
    }
    
    return (result);
}
58882
def getStats(self):
        
        info_dict = {}
        args = [varnishstatCmd, '-1']
        if self._instance is not None:
            args.extend(['-n', self._instance])
        output = util.exec_command(args)
        if self._descDict is None:
            self._descDict = {}
        for line in output.splitlines():
            mobj = re.match('(\S+)\s+(\d+)\s+(\d+\.\d+|\.)\s+(\S.*\S)\s*$', 
                            line)
            if mobj:
                fname = mobj.group(1).replace('.', '_')
                info_dict[fname] = util.parse_value(mobj.group(2))
                self._descDict[fname] = mobj.group(4)
        return info_dict
326702
def _get_stats_files(data, out_dir=None):
    
    if not out_dir:
        out_dir = utils.safe_makedir(os.path.join(dd.get_work_dir(data),
                                                  "qc", dd.get_sample_name(data), "samtools"))
    stats_file = tz.get_in(["depth", "samtools", "stats"], data)
    idxstats_file = tz.get_in(["depth", "samtools", "idxstats"], data)
    if not stats_file:
        stats_file = os.path.join(out_dir, "%s.txt" % dd.get_sample_name(data))
    if not idxstats_file:
        idxstats_file = os.path.join(out_dir, "%s-idxstats.txt" % dd.get_sample_name(data))
    return stats_file, idxstats_file
612806
def stat(filename, use_cache_only=False):
    """"""
    filename = pyc2py(filename)
    if filename not in file_cache:
        if not use_cache_only: cache_file(filename)
        if filename not in file_cache:
            return None
        pass
    return file_cache[filename].stat