Questions tagged [gio]

GIO is striving to provide a modern, easy-to-use VFS API that sits at the right level in the library stack, as well as other generally useful APIs for desktop applications (such as networking and D-Bus support). The goal is to overcome the shortcomings of GnomeVFS and provide an API that is so good that developers prefer it over raw POSIX calls. Among other things that means using GObject.

189 questions
2
votes
1 answer

use glib gio GVolumeMonitor without GNOME

I have a problem with the glib / gio GVolumeMonitor. When I run this code g_type_init(); GVolumeMonitor *vmon = g_volume_monitor_get(); GList *drives = g_volume_monitor_get_connected_drives(vmon); printf("DRIVES: %p\n", drives); inside gnome I get…
Michael W
  • 303
  • 1
  • 3
  • 10
2
votes
1 answer

In GIO, why do these asynchronous file IO operations never complete? (applies to both C and Vala)

I want to perform asynchronous file IO operations. Here is a simplified version of what I am trying to do in Vala: void main(string[] args) { store_async(); while(true) ; } async void store_async() { File file =…
Matthew
  • 28,056
  • 26
  • 104
  • 170
1
vote
0 answers

How to use the keyfile settings backend from PyGObject?

GIO (GLib's I/O library) has a backend for GSettings that uses a keyfile. From C, you can create an instance of this backend in order to force use of a keyfile instead of the system registry, using g_keyfile_settings_backend_new() and then…
ptomato
  • 56,175
  • 13
  • 112
  • 165
1
vote
1 answer

gobject-introspection not building

I am trying to compile gobject-introspection-1.31.0 (GI) for i686-cm-linux from a i686-pc-linux-gnu machine. Please find the part of config.log for the same. While configuring GI, libraries of glib, gio, gobject and python and many others are found…
vishalnayakv
  • 11
  • 1
  • 4
1
vote
0 answers

Does GVolume knows about the type

I need to find out if a GVolume instance is a hard drive, CD-ROM, floppy or USB. I didn't find any getter that will give me this information in the docs. How can I find this information?
Igor
  • 5,620
  • 11
  • 51
  • 103
1
vote
2 answers

It's legal to mix c++0x threads with gio GCancellable?

If I'm not wrong there is no easy way to make a c++0x thread cancellable. I'm wondering if it's legal to use GCancellable mixing it with c++0x thread. If the answer is No I guess I should use glib threads or it's not so legal too?
1
vote
1 answer

GIO: get_icon() always returns None

According to the GIO Documentation, it is possible to get the Icon of a file through g_file_info_get_icon () http://developer.gnome.org/gio/stable/GFileInfo.html#g-file-info-get-icon But this doesnt work, take a look at this sample: print(somefile)…
jgillich
  • 71,459
  • 6
  • 57
  • 85
1
vote
1 answer

Why does Gio::Settings require a delay?

I'm writing an application in C++ that uses both Qt and GIO. It happens to be an embedded Linux platform, but I don't know if that matters much. I have a function that sets a setting that another program uses: void setCityName(const QString…
Edward
  • 6,964
  • 2
  • 29
  • 55
1
vote
0 answers

How can I create a GVariant* to feed to g_variant_iter_new?

The following simple code is sufficient to reproduce the error I am having. #include int main() { GVariantIter *Iter; const gchar* s = "[('appname', uint64 size, uint64 field, false)]"; GVariant* up =…
Tony Tannous
  • 14,154
  • 10
  • 50
  • 86
1
vote
2 answers

How can I make a TLS connection using Vala?

I'm trying to figure out how can I make a proper TLS connection using Gio. The Gio documentation says you can create a TLS connection just by setting the tls flag on the SocketClient. Below is a Gio networking sample from the gnome wiki. When I set…
semicolon
  • 23
  • 5
1
vote
1 answer

OpenVPN v3 Dbus client not receiving all signals

I'm writing an Applet for Linux Mint/Cinnamon to manage OpenVPN v3 connections. In order to avoid synchronous calls that can cause the DE to stutter or freeze, I'm writing a simple DBus client using the Gio and GLib libraries provided by GJS. This…
moogpwns
  • 351
  • 3
  • 5
1
vote
1 answer

Problem about GThread and file copy

// gcc -o 0 $(pkg-config --cflags --libs gtk+-2.0) 1.c #include #include struct tst { GtkWidget *win, *w2, *hb, *vb, *ent, *btn, *b2, *pbar; GtkAccelGroup *acc; }; GCancellable *can1; GError *err1; GThread…
5frame
  • 101
  • 1
  • 8
1
vote
0 answers

How to detect used file monitor in "gio monitor"

glib supports several file monitors. The used monitor can be detected by calling G_OBJECT_TYPE_NAME (monitor). When using the gio program, there is no documented way to determine this. Or is it possible?
Michael Albinus
  • 1,571
  • 9
  • 19
1
vote
1 answer

JS ERROR: Error: Expected an object of type GCancellable for argument 'cancellable' but got type string

I'm trying to follow this tutorial. Basically, I want to create my custom function that creates a folder if it not exists. var makeDir = (path) => { const file = Gio.file_new_for_path(path); if (file.query_exists(path)) { print(`Dir…
Ivan Banha
  • 753
  • 2
  • 12
  • 23
1
vote
0 answers

cross-platform network interface enumeration

I need to enumerate local network interfaces (IPv4, IPv6), getting their addresses and netmasks. The code which should run both under Linux and newly under Windows (mingw64). I was looking at getaddrinfo which is somewhat cross-platform (both POSIX…
eudoxos
  • 18,545
  • 10
  • 61
  • 110