[patch] kfilemediaplugin and filesize

Jos van den Oever jvdoever at gmail.com
Thu Nov 2 22:53:23 GMT 2006


I'd love to know too if statvfs is standard across platforms. It seems
to be not present on Windows though. A very useful function to prevent
programs from filling up the harddrive would be something like:
float getPercentageDiskFull(dir)
or
int64_t getFreeSpace(dir)
where dir is an arbitrary directory. The function would then find out
itself which partition it belonged to and what percentage of space was
still free.

Cheers,
Jos
2006/11/2, Martin Koller <m.koller at surfeu.at>:
> Hi,
>
> looking at
> https://bugs.kde.org/show_bug.cgi?id=132269
> I found that the implementation for the filesize in mentioned plugin uses
> unsigned long
> Probably it's safer to use KIO::filesize_t
>
> I changed that. Also, it's not clear for me why it uses the KDiskFreeSp class
> as this needs an external program to get the data, which is a lot overhead.
>
> I changed the kfile-plugin to directly call statvfs()
> The man page says, statvfs() is conforming to POSIX. Can I safely assume this
> is available on all supported platforms ?
> (it seems that KDiskFreeSp relied on the fact that there is a "df" program
> available)
>
> If I don't miss something, I'd suggest that KDiskFreeSp shall be removed in
> KDE-4.
> Wasn't there a URL where I can check which other KDE files use that class
> (cross reference) ?
>
> Do you think this is OK to commit ?
>
> (The patch is against KDE-3.5.5, but if OK I'd change it in KDE-4, too)
> --
> Best regards/Schöne Grüße
>
> Martin    ()  ascii ribbon campaign - against html mail
>           /\                        - against microsoft attachments
>
> Computers and Internet gave you freedom.
> TCPA would TAKE your FREEDOM!  http://www.againsttcpa.com
>
>
>


More information about the kde-core-devel mailing list