Returns the size of the file.

           For efficiency this operation does not use locking, so may return
           inconsistent data. Use it for informational purposes.
507572
def file_size(self, name, force_refresh=False):
        

        uname, version = split_name(name)

        t = time.time()
        logger.debug('    querying size of %s', name)
        try:
            if not self.remote_store or (version is not None
                                         and not force_refresh):
                try:
                    if self.local_store and self.local_store.exists(name):
                        return self.local_store.file_size(name)
                except Exception:
                    if self.remote_store:
                        logger.warning("Error getting '%s' from local store",
                                       name, exc_info=True)
                    else:
                        raise
            if self.remote_store:
                return self.remote_store.file_size(name)
            raise FiletrackerError("File not available: %s" % name)
        finally:
            logger.debug('    processed %s in %.2fs', name, time.time() - t)
1278465
def filesize(self):
        
        if self.from_stdin:
            return None
        if not self._filesize:
            self._calculate_bounds()
        return self._filesize
459646
private int getSize() {

        return Integer.valueOf(
            (String)CmsVaadinUtils.getRequest().getSession().getAttribute(ATTR_FILE_VIEW_SIZE)).intValue();
    }
1197441
def _get_file_size(path, get_retriever):
    
    integration, config = get_retriever.integration_and_config(path)
    if integration:
        return integration.file_size(path, config)
    elif os.path.exists(path):
        return os.path.getsize(path) / (1024.0 * 1024.0)
1017939
def read(self, size=None):
        
        if self.closed:
            raise ValueError("I/O operation on closed file")

        buf = b""
        if self.buffer:
            if size is None:
                buf = self.buffer
                self.buffer = b""
            else:
                buf = self.buffer[:size]
                self.buffer = self.buffer[size:]

        if size is None:
            buf += self.fileobj.read()
        else:
            buf += self.fileobj.read(size - len(buf))

        self.position += len(buf)
        return buf
929304
def read(self, size=1):
        
        if self.is_closed_flag:
            raise Exception("Unable to read - already closed!")
        if self.get_remaining_size() < size:
            raise Exception("Unable to read byte buffer - too short remaining data size!")
        self.read_count += size
        return self.file.read(size)
1362066
public final int size()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "size");
    int result = (m_tail >= m_head) ? (m_tail - m_head) : (m_array.length - m_head + m_tail);
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "size", new Integer(result));
    return result;
  }
316875
def size(self):
        """"""
        total_size = 0
        for dir_path, dir_names, filenames in os.walk(self.dir):
            for f in filenames:
                fp = os.path.join(dir_path, f)
                total_size += os.path.getsize(fp)
        return total_size
567432
int getTrieSize()  {
        int size = 0;
        try {
            // The trie serialize function returns the size of the data written.
            //    null output stream says give size only, don't actually write anything.
            size = fTrie.serialize(null, true, dm );
        } catch (IOException e) {
            Assert.assrt (false);
        }
        return size;
    }
845170
@Override
    public long getFileSize() {
        try {
            final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_UDP);
            try {
                return BlockingWrapper.execute(() -> client.getFileSize_1());
            } finally {
                client.close();
            }
        } catch (OncRpcException | IOException | InterruptedException | RuntimeException ex) {
            LOG.log(Level.SEVERE, "getFileSize RPC call failed", ex);
            throw new RuntimeException("RPC call failed", ex);
        }
    }
408492
def get_file_size(self, fid):
        
        url = self.get_file_url(fid)
        res = self.conn.head(url)
        if res is not None:
            size = res.headers.get("content-length", None)
            if size is not None:
                return int(size)
        return None
409738
def _get_file_size(self):
        
        file_size = retry(self._retry_count)(_get_content_length)(
            self._session, self.url, self._timeout
        )
        file_size = int(file_size)
        if file_size == 0:
            with io.open(self._file_path, 'a', encoding='utf-8'):
                pass
        return file_size
1324661
public function getSize() : int
    {
        $size = -1;

        if ($this->isFile()) {
            $size = filesize($this->realPath);
        }

        return $size;
    }
228789
def GetByteSize(self):
    
    if self._byte_size is None and self.members:
      self._byte_size = 0
      for member_definition in self.members:
        byte_size = member_definition.GetByteSize()
        if byte_size is None:
          self._byte_size = None
          break

        self._byte_size = max(self._byte_size, byte_size)

    return self._byte_size
467999
public int size() {
		Record record = client.operate(this.policy, this.key, ListOperation.size(this.binNameString));
		if (record != null) {
			return record.getInt(this.binNameString);
		}
		return 0;
	}
961683
def get_file_size(filename):
    
    if filename is None:
        return float(0)
    if type(filename) is list:
        return float(sum([get_file_size(x) for x in filename]))
    try:
        total_bytes = sum([float(os.stat(f).st_size)
                           for f in filename.split(" ") if f is not ''])
    except OSError:
        # File not found
        return 0.0
    else:
        return float(total_bytes) / (1024 ** 3)
1154376
function size(file) {
  if (!exists(file) || !isFile(file)) {
    return -1;
  } else {
    try {
      return _fileStats(file).size;
    } catch (e) {
      return -1;
    }
  }
}