KDiskFreeSpaceInfo

KDE 4.2 PyKDE API Reference

- KDE's Python API

# KDiskFreeSpaceInfo Class Reference

`from PyKDE4.kio import *`

## Detailed Description

\class KDiskFreeSpaceInfo kdiskfreespaceinfo.h KDiskFreeSpaceInfo

Determine the space left on an arbitrary partition.

This class determines the free space left on the partition that holds a given path. This path can be the mount point or any file or directory on the partition.

To find how much space is available on the partition containing path, simply do the following:

##

##

##

     KDiskFreeSpaceInfo info = KDiskFreeSpaceInfo.freeSpaceInfo( path );
     if( info.isValid() )
        doSomething( info.available() );
     \code

     \author Sebastian Trueg <trueg@kde.org>

     \since 4.2

    Methods
     __init__ (self, KDiskFreeSpaceInfo a0)
     __init__ (self)
    KIO.filesize_t available (self)
    bool isValid (self)
    QString mountPoint (self)
    KIO.filesize_t size (self)
    KIO.filesize_t used (self)

    Static Methods
    KDiskFreeSpaceInfo freeSpaceInfo (QString path)

    Method Documentation

    __init__
    (
     self,

    KDiskFreeSpaceInfo
    a0

    )

    Copy constructor

    __init__
    (

    self )

    KIO.filesize_t available
    (

    self )

    The available space in the partition mounted at mountPoint()

    Only valid if isValid() returns true.

    Returns: Available space left on the requested partition in bytes.

    KDiskFreeSpaceInfo freeSpaceInfo
    (
    QString
    path

    )

    Static method used to determine the free disk space.

    Parameters:

    path  An arbitrary path. The available space will be
    determined for the partition containing path.

     Check isValid() to see if the process was successful. Then
    use mountPoint(), size(), available(), and used() to access
    the requested values.

    bool isValid
    (

    self )

    Returns: true if the available disk space was successfully
    determined and the values from mountPoint(), size(), available(),
    and used() are valid. false otherwise.

    QString mountPoint
    (

    self )

    The mount point of the partition the requested path points to

    Only valid if isValid() returns true.

    KIO.filesize_t size
    (

    self )

    The total size of the partition mounted at mountPoint()

    Only valid if isValid() returns true.

    Returns: Total size of the requested partition in bytes.

    KIO.filesize_t used
    (

    self )

    The used space in the partition mounted at mountPoint()

    Only valid if isValid() returns true.

    Returns: Used space on the requested partition in bytes.