コード例 #1
0
def total_blocks():
    '''
    Return the total number of blocks remaining.
    '''
    if sys.platform == "win32":
        sectPerCluster, bytesPerSector, freeClusters, totalClusters = win32file.GetDiskFreeSpace(
            get_base_dir())
        return totalClusters
    else:
        return os.statvfs(get_base_dir()).f_blocks
コード例 #2
0
def bytes_remaining():
    '''
    Return the number of bytes available on the system.
    '''
    if sys.platform == "win32":
        sectPerCluster, bytesPerSector, freeClusters, totalClusters = win32file.GetDiskFreeSpace(
            get_base_dir())
        return sectPerCluster * bytesPerSector * totalClusters
    else:
        stats = os.statvfs(get_base_dir())
        return stats.f_frsize * stats.f_bavail
コード例 #3
0
def total_bytes():
    '''
    Return the size of the file system in bytes.
    '''
    if sys.platform == "win32":
        sectPerCluster, bytesPerSector, freeClusters, totalClusters = win32file.GetDiskFreeSpace(
            get_base_dir())
        return sectPerCluster * bytesPerSector * totalClusters
    else:
        stats = os.statvfs(get_base_dir())
        return stats.f_frsize * stats.f_blocks
コード例 #4
0
def percent_remaining():
    '''
    Return the percent (as a number between 0 and 1)
    available for writing on the file system.
    '''
    if sys.platform == "win32":
        return 1.0
        # simulated
        sectPerCluster, bytesPerSector, freeClusters, totalClusters = win32file.GetDiskFreeSpace(
            get_base_dir())
        return sectPerCluster * bytesPerSector * totalClusters
    else:
        stats = os.statvfs(get_base_dir())
        return 1.0 * stats.f_bavail / stats.f_blocks
コード例 #5
0
def percent_remaining():
    '''
    Return the percent (as a number between 0 and 1)
    available for writing on the file system.
    '''
    stats = os.statvfs(get_base_dir())
    return 1.0 * stats.f_bavail / stats.f_blocks
コード例 #6
0
def percent_remaining():
    '''
    Return the percent (as a number between 0 and 1)
    available for writing on the file system.
    '''
    stats = os.statvfs(get_base_dir())
    return 1.0 * stats.f_bavail / stats.f_blocks
コード例 #7
0
def bytes_remaining():
    '''
    Return the number of bytes available on the system.
    '''
    stats = os.statvfs(get_base_dir())
    return stats.f_frsize * stats.f_bavail
コード例 #8
0
def total_bytes():
    '''
    Return the size of the file system in bytes.
    '''
    stats = os.statvfs(get_base_dir())
    return stats.f_frsize * stats.f_blocks
コード例 #9
0
def blocks_remaining():
    '''
    Return the total number of blocks available.
    '''
    return os.statvfs(get_base_dir()).f_bavail
コード例 #10
0
def total_blocks():
    '''
    Return the total number of blocks remaining.
    '''
    return os.statvfs(get_base_dir()).f_blocks
コード例 #11
0
def bytes_remaining():
    '''
    Return the number of bytes available on the system.
    '''
    stats = os.statvfs(get_base_dir())
    return stats.f_frsize * stats.f_bavail
コード例 #12
0
def total_bytes():
    '''
    Return the size of the file system in bytes.
    '''
    stats = os.statvfs(get_base_dir())
    return stats.f_frsize * stats.f_blocks
コード例 #13
0
def blocks_remaining():
    '''
    Return the total number of blocks available.
    '''
    return os.statvfs(get_base_dir()).f_bavail
コード例 #14
0
def total_blocks():
    '''
    Return the total number of blocks remaining.
    '''
    return os.statvfs(get_base_dir()).f_blocks