Re: libgpod itdb_device_get_storage_info

Christophe Fergeau <[email protected]>
Newsgroups gmane.comp.ipod.gtkpod
Message-ID <20110321100025.GB11676@merlin>
Hi,

On Sat, Mar 19, 2011 at 05:31:38PM -0400, Adam Lewis wrote:
> Here is a rough approximation of what the patch would look like:
> 
>         GFile *root;
>         GFileInfo *info;
>         guint64 capacity, free;
> 
>         root = g_file_new_for_path (device->mountpoint);
> 
>         info = g_file_query_filesystem_info (root, "*", NULL, NULL);
>         g_object_unref (G_OBJECT (root));
>         if (info == NULL) {
>                 return 0;
>         }
> 
>         capacity = g_file_info_get_attribute_uint64 (info,
> G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
>         free = g_file_info_get_attribute_uint64 (info,
> G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
>         g_object_unref (G_OBJECT (info));


I tend to think this kind of things should be handled by the application
using, it's at the same level as detecting whether a newly plugged device
is an iPod and this kind of things. On the other hand, this is at least the
2nd time such an API is requested which means there's a real need for it :)
However, if we add this API, we'll probably also want a way to get the
space used by music/movies/ebooks/other files.

Christophe

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d

_______________________________________________
Gtkpod-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-devel
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk2HIbkACgkQJKRp+3pW947/pACeK0W5BStNqjZ62lADL7kpFh2Y
uM0An3kkeyJMiRw11+INAMQw6g1s7nu4
=n+PA
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.