Returns available diskspace information.

@return array
975675
public function getQuotaInfo()
    {
        $absolute = realpath($this->path);

        return [
            disk_total_space($absolute) - disk_free_space($absolute),
            disk_free_space($absolute),
        ];
    }
312549
public function getFileNamespaces()
    {
        if (!isset($this->fileNamespaces)) {
            $this->fileNamespaces = $this->findFileNamespaces();
        }

        return $this->fileNamespaces;
    }
400442
public function getSize() {

	    $bytestotal = 0;
	    $path 		= realpath($this -> directory -> getPath());

	    if($path !== false) {

	        foreach(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \FilesystemIterator :: SKIP_DOTS)) as $object) {
	            $bytestotal += $object->getSize();
	        }
	    }

	    return $bytestotal;
	}
363151
public function getSpacesAsChoices(): array
    {
        $spaces = [];

        foreach ($this->clientsConfig as $clientConfig) {
            /** @var \Contentful\Delivery\Client $client */
            $client = $clientConfig['service'];

            $spaces[$client->getSpace()->getName()] = $clientConfig['space'];
        }

        return $spaces;
    }
626310
def _get_space(self):
        
        '''  '''
        
        title = '%s._space_id' % self.__class__.__name__
        list_kwargs = {
            'q': "'%s' in parents" % self.drive_space,
            'spaces': self.drive_space,
            'fields': 'files(name, parents)',
            'pageSize': 1
        }
        try:
            response = self.drive.list(**list_kwargs).execute()
        except:
            raise DriveConnectionError(title)
        for file in response.get('files',[]):
            self.space_id = file.get('parents')[0]
            break
        return self.space_id
118233
public function getFileInfo()
    {
        $fullName = str_replace('source/','',$this->fullName);
        return [
            "msg"    => $this->stateInfo,
            "code" => $this->stateInfo == "SUCCESS" ? 0 : $this->stateInfo,
            "data"=>[
                "src"=>$this->imgDomain.$fullName,
                'title'=>$fullName,
            ],
            "type"     => $this->fileType,
            "size"     => $this->fileSize
        ];
    }
823314
public function getAll(){
        $rest = $this->getService( self::API_STORAGE_DISK);
        $rest->GET();

        return $rest->getResultAsArray( models\Storage\StorageDisk::class);
    }
1305147
public function getDiskData($wmiConnection) {

        $LogicalDisk = $wmiConnection->query("SELECT Size, FreeSpace, DeviceID FROM Win32_LogicalDisk");

        $return = Array();

        $index = 0;
        foreach ($LogicalDisk as $wmi_LogicalDisk) {
            if (isset($wmi_LogicalDisk->Size) and $wmi_LogicalDisk->Size > 0) {
                $return['index'][$index] = $index;
                $return['total_size'][$index] = $wmi_LogicalDisk->Size;
                $return['free_size'][$index] = $wmi_LogicalDisk->FreeSpace;
                $return['used_size'][$index] = $return['total_size'][$index] - $return['free_size'][$index];
                $return['used_percent'][$index] = round((($return['free_size'][$index] / $return['total_size'][$index]) * 100), 2);
                $return['free_percent'][$index] = round((($return['used_size'][$index] / $return['total_size'][$index]) * 100), 2);
                $return['path'][$index] = $wmi_LogicalDisk->DeviceID;
                $index++;
            }
        }

        return $return;
    }
581643
function getTotalSpace(): float {
		$directory = $this->isDirectory () ? $this->fileName : $this->getParent ();
		return disk_total_space ( $directory );
	}
302686
private function _getVolumeKeys(): array
    {
        if (!$this->availableVolumes) {
            return [];
        }

        $criteria = ['parentId' => ':empty:'];

        if ($this->availableVolumes !== '*') {
            $criteria['volumeId'] = Db::idsByUids('{{%volumes}}', $this->availableVolumes);
        }

        $folders = Craft::$app->getAssets()->findFolders($criteria);

        // Sort volumes in the same order as they are sorted in the CP
        $sortedVolumeIds = Craft::$app->getVolumes()->getAllVolumeIds();
        $sortedVolumeIds = array_flip($sortedVolumeIds);

        $volumeKeys = [];

        usort($folders, function($a, $b) use ($sortedVolumeIds) {
            // In case Temporary volumes ever make an appearance in RTF modals, sort them to the end of the list.
            $aOrder = $sortedVolumeIds[$a->volumeId] ?? PHP_INT_MAX;
            $bOrder = $sortedVolumeIds[$b->volumeId] ?? PHP_INT_MAX;

            return $aOrder - $bOrder;
        });

        foreach ($folders as $folder) {
            $volumeKeys[] = 'folder:'.$folder->uid;
        }

        return $volumeKeys;
    }
187108
public function getTotalSavedBytes()
    {
        $initialStep = array_first($this->referencePoints);
        $lastStep = array_last($this->referencePoints);

        return $initialStep->getBytes() - $lastStep->getBytes();
    }
202291
public function getUnitOptions()
    {
        $unitGroup = [
            'speed' => ['bps', 'kbps', 'mbps', 'gbps', 'tbps'],
            'size' => ['mb', 'mb10', 'mb100', 'gb', 'tb'],
        ];

        $availableUnitsByPriceType = [
            'overuse,ip_num' => ['items'],
            'overuse,support_time' => ['hour'],
            'overuse,backup_du' => $unitGroup['size'],
            'overuse,server_traf_max' => $unitGroup['size'],
            'overuse,server_traf95_max' => $unitGroup['speed'],
            'overuse,server_du' => $unitGroup['size'],
            'overuse,server_ssd' => $unitGroup['size'],
            'overuse,server_sata' => $unitGroup['size'],
            'overuse,backup_traf' => $unitGroup['size'],
            'overuse,domain_traf' => $unitGroup['size'],
            'overuse,domain_num' => ['items'],
            'overuse,ip_traf_max' => $unitGroup['size'],
            'overuse,account_traf' => $unitGroup['size'],
            'overuse,account_du' => $unitGroup['size'],
            'overuse,mail_num' => ['items'],
            'overuse,mail_du' => $unitGroup['size'],
            'overuse,db_num' => ['items'],
        ];

        $units = Ref::getList('type,unit', 'hipanel.finance.units', [
            'with_recursive' => 1,
            'select' => 'oname_label',
            'mapOptions' => ['from' => 'oname'],
        ]);

        $possibleTypes = $availableUnitsByPriceType[$this->type] ?? [];

        return array_intersect_key($units, array_combine($possibleTypes, $possibleTypes));
    }
1341368
public function getSize()
    {
        if ($this->isDirty && $this->bytes) {
            return strlen($this->bytes);
        }
        if ($this->isDirty && $this->filename) {
            return filesize($this->filename);
        }
        if ($this->mongoGridFSFile instanceof \MongoGridFSFile) {
            return $this->mongoGridFSFile->getSize();
        }
        return 0;
    }
408604
public function size()
    {
        eZDebugSetting::writeDebug( 'kernel-clustering', "dfs::size()" );
        return isset( $this->metaData['size'] ) ? (int)$this->metaData['size'] : null;
    }
182585
def usage():
    '''
    
    '''
    drives = []
    ret = {}
    drive_bitmask = ctypes.windll.kernel32.GetLogicalDrives()
    for letter in UPPERCASE:
        if drive_bitmask & 1:
            drives.append(letter)
        drive_bitmask >>= 1
    for drive in drives:
        try:
            (available_bytes,
             total_bytes,
             total_free_bytes) = win32api.GetDiskFreeSpaceEx(
                 '{0}:\\'.format(drive)
            )
            used = total_bytes - total_free_bytes
            capacity = used / float(total_bytes) * 100
            ret['{0}:\\'.format(drive)] = {
                'filesystem': '{0}:\\'.format(drive),
                '1K-blocks': total_bytes / 1024,
                'used': used / 1024,
                'available': total_free_bytes / 1024,
                'capacity': '{0:.0f}%'.format(capacity),
            }
        except Exception:
            ret['{0}:\\'.format(drive)] = {
                'filesystem': '{0}:\\'.format(drive),
                '1K-blocks': None,
                'used': None,
                'available': None,
                'capacity': None,
            }
    return ret
385683
protected function getFileNamespace()
    {
        if ($this->type == self::TYPE_APP) {
            return 'app\\blocks';
        }

        return Yii::$app->getModule($this->moduleName)->getNamespace()  . '\\blocks';
    }
1005560
public function getHD()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Drives');
        }

        $drives = array();
        $partitions = array();

        foreach ($this->wmi->ExecQuery('SELECT DiskIndex, Size, DeviceID, Type FROM Win32_DiskPartition') as $partition) {
            $partitions[$partition->DiskIndex][] = array(
                'size' => $partition->Size,
                'name' => $partition->DeviceID.' ('.$partition->Type.')',
            );
        }

        foreach ($this->wmi->ExecQuery('SELECT Caption, DeviceID, Index, Size FROM Win32_DiskDrive') as $drive) {
            $caption = explode(' ', $drive->Caption);
            $drives[] = array(
                'name' => $drive->Caption,
                'vendor' => reset($caption),
                'device' => $drive->DeviceID,
                'reads' => false,
                'writes' => false,
                'size' => $drive->Size,
                'partitions' => array_key_exists($drive->Index, $partitions) && is_array($partitions[$drive->Index]) ? $partitions[$drive->Index] : false,
            );
        }

        usort($drives, array('Linfo\OS\Windows', 'compare_drives'));

        return $drives;
    }