From: Paul G. R. <p.g...@ph...> - 2008-05-24 16:51:06
Attachments:
read-sysinfoextended-sgutils.patch
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Christophe, Find attached patch for read-sysinfoextended tool. Turns out it is quite intricate to get from a mountpoint to a device node so have cheated and used df. Seems to work happily enough and if it fails then user can still fall back to 3 argument way. See what you think... Regards PGR - -- P.G. Richardson Email: p.g...@ph... - --- "There is no present or future, only the past happening over and over again now." Eugene O'Neille "History is the nightmare from which I am trying to awake." James Joyce -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFIOEdgcthLMIwdEb0RAh0TAJ94J4L0+wQ+IJCgFd35QM1zPErD4gCg7EGc VAu6oiFHPp1zz1EiBGJOxdo= =1B52 -----END PGP SIGNATURE----- |
From: Bastien N. <ha...@ha...> - 2008-05-24 17:44:30
|
On Sat, 2008-05-24 at 17:50 +0100, Paul G. Richardson wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Christophe, > > Find attached patch for read-sysinfoextended tool. > > Turns out it is quite intricate to get from a mountpoint to a device > node so have cheated and used df. Seems to work happily enough and if it > fails then user can still fall back to 3 argument way. > > See what you think... It's pretty gruesome, to be honest. Something like that would work, if you're willing to use GIO (in glib 2.16 and above): GFile *sysinfo_file; char *sysinfo_path; GMount *mount; GVolume *volume; char *device; /* Get a GFile for a file on the partition */ sysinfo_path = g_build_filename (mountpoint, "file", "that", "should", "exist", "on", "the", "ipod", NULL); sysinfo_file = g_file_new_for_path (sysinfo_path); g_free (sysinfo_path); /* Get the GMount for the file */ mount = g_file_find_enclosing_mount (sysinfo_file, NULL, NULL); g_object_unref (sysinfo_file); if (mount == NULL) { /* bleh */ } /* Get the GVolume for the mount, and the device */ volume = g_mount_get_volume (mount); g_object_unref (mount); device = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE); g_object_unref (volume); Voila, device is your string with the path to the Unix device. Note that you could also port the application to GOption to clean up the options parsing... Cheers |
From: Paul G. R. <p.g...@ph...> - 2008-05-25 08:37:51
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bastien Nocera wrote: | On Sat, 2008-05-24 at 17:50 +0100, Paul G. Richardson wrote: |> -----BEGIN PGP SIGNED MESSAGE----- |> Hash: SHA1 |> |> Christophe, |> |> Find attached patch for read-sysinfoextended tool. |> |> Turns out it is quite intricate to get from a mountpoint to a device |> node so have cheated and used df. Seems to work happily enough and if it |> fails then user can still fall back to 3 argument way. |> |> See what you think... | | It's pretty gruesome, to be honest. | | Something like that would work, if you're willing to use GIO (in glib | 2.16 and above): | | GFile *sysinfo_file; | char *sysinfo_path; | GMount *mount; | GVolume *volume; | char *device; | | /* Get a GFile for a file on the partition */ | sysinfo_path = g_build_filename (mountpoint, "file", "that", "should", | "exist", "on", "the", "ipod", NULL); | sysinfo_file = g_file_new_for_path (sysinfo_path); | g_free (sysinfo_path); | | /* Get the GMount for the file */ | mount = g_file_find_enclosing_mount (sysinfo_file, NULL, NULL); | g_object_unref (sysinfo_file); | if (mount == NULL) { | /* bleh */ | } | | /* Get the GVolume for the mount, and the device */ | volume = g_mount_get_volume (mount); | g_object_unref (mount); | device = g_volume_get_identifier (volume, | G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE); | g_object_unref (volume); | | Voila, device is your string with the path to the Unix device. Note that | you could also port the application to GOption to clean up the options | parsing... | | Cheers | Thanks for the constructive feedback. Your comments are well received. The problem with your suggestion is that libgpod currently supports glib back to 2.8. This may not be needed anymore but that is something to be determined before including something as recent as GIO 2.16. I can certainly add your code to my patch for those instances where users are running 2.16+, especially given your code is more elegant than my gruesome attempt. Any ideas on achieving the same goal using only glib 2.8? Regards PGR - -- P.G. Richardson Email: p.g...@ph... - --- "There is no present or future, only the past happening over and over again now." Eugene O'Neille "History is the nightmare from which I am trying to awake." James Joyce -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFIOSVJcthLMIwdEb0RAvs1AJ9jlDMNQI8JkaZIQsanOoukQecGOACcCoxC ECzHRBSjzmxzoV6OGEhLX5M= =p1l8 -----END PGP SIGNATURE----- |
From: Bastien N. <ha...@ha...> - 2008-06-10 23:00:07
|
On Sun, 2008-05-25 at 09:37 +0100, Paul G. Richardson wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Bastien Nocera wrote: > | On Sat, 2008-05-24 at 17:50 +0100, Paul G. Richardson wrote: > |> -----BEGIN PGP SIGNED MESSAGE----- > |> Hash: SHA1 > |> > |> Christophe, > |> > |> Find attached patch for read-sysinfoextended tool. > |> > |> Turns out it is quite intricate to get from a mountpoint to a device > |> node so have cheated and used df. Seems to work happily enough and if it > |> fails then user can still fall back to 3 argument way. > |> > |> See what you think... > | > | It's pretty gruesome, to be honest. > | > | Something like that would work, if you're willing to use GIO (in glib > | 2.16 and above): > | > | GFile *sysinfo_file; > | char *sysinfo_path; > | GMount *mount; > | GVolume *volume; > | char *device; > | > | /* Get a GFile for a file on the partition */ > | sysinfo_path = g_build_filename (mountpoint, "file", "that", "should", > | "exist", "on", "the", "ipod", NULL); > | sysinfo_file = g_file_new_for_path (sysinfo_path); > | g_free (sysinfo_path); > | > | /* Get the GMount for the file */ > | mount = g_file_find_enclosing_mount (sysinfo_file, NULL, NULL); > | g_object_unref (sysinfo_file); > | if (mount == NULL) { > | /* bleh */ > | } > | > | /* Get the GVolume for the mount, and the device */ > | volume = g_mount_get_volume (mount); > | g_object_unref (mount); > | device = g_volume_get_identifier (volume, > | G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE); > | g_object_unref (volume); > | > | Voila, device is your string with the path to the Unix device. Note that > | you could also port the application to GOption to clean up the options > | parsing... > | > | Cheers > | > > Thanks for the constructive feedback. Your comments are well received. > > The problem with your suggestion is that libgpod currently supports glib > back to 2.8. This may not be needed anymore but that is something to be > determined before including something as recent as GIO 2.16. glib 2.8 is was released in 2005. Maybe it's time to move on a bit :) > I can certainly add your code to my patch for those instances where > users are running 2.16+, especially given your code is more elegant than > my gruesome attempt. > > Any ideas on achieving the same goal using only glib 2.8? Disable the feature if glib 2.16 isn't in use, or use gnome-vfs which provides similar functionality (but is already deprecated). In the worst case, you could cut'n'paste the mtab reading code from gnome-vfs or glib, but I would advise against that... Cheers |
From: Jan K. <JKubitschek@JakPod.de> - 2008-06-18 08:53:58
|
Hi, because of http://ipodlinux.org seems to be down since some days and i need some informations about the iTunesDB (especially about index creation (indexType 1D, 1E, 1F) of mhod type 34) - does someone here knows about a mirror of this page (or another good description of the iTunesDB)? Thank you! Kind regards, Jan. |
From: Javier K. <jk...@gm...> - 2008-06-18 09:07:16
|
Yes, we do: http://www.google.com/search?hl=pl&q=site%3Aipodlinux.org+mhod+type+34&btnG=Szukaj&lr= Google cache (hopefully) to the rescue. On Wed, Jun 18, 2008 at 10:53 AM, Jan Kubitschek <JKu...@ja...> wrote: > Hi, > > because of http://ipodlinux.org seems to be down since some days and i > need some informations about the iTunesDB (especially about index > creation (indexType 1D, 1E, 1F) of mhod type 34) - does someone here > knows about a mirror of this page (or another good description of the > iTunesDB)? > > Thank you! > > Kind regards, Jan. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Gtkpod-devel mailing list > Gtk...@li... > https://lists.sourceforge.net/lists/listinfo/gtkpod-devel > |