Hello everyone,
I’m using glib for a multiplatform project:
I’ve an issue with g_file_load_contents that seems not correctly working with uri on Windows. This following function works well on GNU/Linux, but on Windows I only get the last line, for example with this url: http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame/-oI/A?M45
GFile is not really an abstraction for downloading data from random URIs: it’s heavily geared towards a file-system-like use, e.g. browsing volumes, enumerating files, querying metadata, etc. Think WebDAV, not a web browser or wget.
Additionally, GFile is implemented through extension points, mostly to avoid additional/circular dependencies to GLib. On Linux this role is deferred to Gvfs, which will use libsoup under the hood anyway. On Windows, there’s an HTTP file implementation, but there’s no guarantee that URI support is fully compliant; it’s likely enough to query the metadata associated to a file accessible via an HTTP connection.
If you know you are going to retrieve a specific file from an HTTP server, using libsoup is more appropriate, as you cut out all the middle layers.