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

How to create InputStream from string in Vala

Given a string named command, I need to create GLib InputStream object How? Thanks
lzap
  • 16,417
  • 12
  • 71
  • 108
2
votes
2 answers

launch_default_for_uri() raises exception when an URL is provided on some systems

I'm using the launch_default_for_uri function from Gio (imported from gi.repository) to open an URL in the user's default browser. This works just fine on my phone running postmarketOS and my desktop running Fedora 32, but in an Alpine Linux virtual…
Newbyte
  • 2,421
  • 5
  • 22
  • 45
2
votes
1 answer

Creating a GIO GFile or GInputStream from std::FILE*

I have to connect two APIs, which use different structures to describe files. One provides me with a std::FILE* and the second one expects a GFile* or GInputStream* belonging to the GIO. Is there a straightforward way to create either object from…
geo
  • 435
  • 3
  • 13
2
votes
1 answer

How do I save a binary file from libzip

My goal is to write file to disk If I use gio to create the file GError *error; char path[strlen(dirpath)]; sprintf(path, "%s", dirpath); // Create path to the file by copying from another variable zip_file_t *contentfile = zip_fopen_index(book,…
Bret Joseph
  • 185
  • 8
2
votes
1 answer

Testing for GVfs metadata support in C

I am trying to add support for per-directory viewing settings to the Thunar file browser of the Xfce desktop. So for example if a user chooses to view the contents of a directory as a list rather than as a grid of icons, this setting is remembered…
2
votes
2 answers

Custom Icon for Gnome Shell Extension in Top Panel not visible

I try to use a custom SVG for my GNOME shell extension as status icon in top panel. But the custom icon is never shown, just the widget's label text. And I find no error in log output. When I try to set a build-in icon like "system-search-symbolic"…
Dodo
  • 156
  • 2
  • 14
2
votes
1 answer

How do I update a gtk listbox from an async method?

So when writing UI in GTK it's generally preferrable to handle reading of files, etc. in an Async Method. things such as listboxes, are generally bound to a ListModel, the items in the ListBox updated in accordance with the items_changed signal. So…
rasmus91
  • 3,024
  • 3
  • 20
  • 32
2
votes
1 answer

How do I initialize a GActionMap variable?

I want to know how to initialize a GActionMap variable. I search here https://developer.gnome.org/gio/stable/GActionMap.html to find a function that instances a GActionMap, but I didn't find it there and anywhere. I was trying to insert some actions…
Wallacy
  • 35
  • 4
2
votes
0 answers

How to connect Buttons to Actions in custom SimpleActionGroups in gtk-rs?

I'd like to use a SimpleActionGroup registered to a Widget that handles SimpleActions. But anyhow every Button that targets to Actions with my custom prefix are grayed out and can't be clicked. However Buttons that are targeting the action prefixes…
dosch
  • 31
  • 6
2
votes
0 answers

Weird stdout/stderr indefinite loop with vala async exec / pipe example

I tried out the example about exec and spawning, when running this with vala or compiling with valac, I get an endless loop of the output below. Is that normal? Incidentally, this is on OS X, normally I am on Linux and I can test it later on…
step21
  • 73
  • 1
  • 7
2
votes
3 answers

Equivalent of open(O_WRONLY | O_CREAT) in GLib?

I need to open a file for writing. If the file already exists, I don't want to truncate it. In other words, in plain C I'd do: int fd = open("output.bin", O_WRONLY | O_CREAT, 0666); // I don't mind using O_RDWR, btw. I'm trying to do something…
Niccolo M.
  • 3,363
  • 2
  • 22
  • 39
2
votes
1 answer

What platforms are supported by gio and gvfs library?

When writing an application using the GIO and GVFS libraries from the GNOME stack what platforms will my application be available for? Will it be possible to compile the application on Windows, Solaris or *BSD, for example? Are the GIO/GVFS and…
blerontin
  • 2,892
  • 5
  • 34
  • 60
2
votes
2 answers

Where can I find the Python bindings for GIO's GSocket?

Where are the Python bindings, or what is the current status of the Python bindings for GIO's GSocket and other lowlevel network support?
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
2
votes
1 answer

Get the contents of GVariant

I currently try to communicate with dbus and have a function, that will return array of struct(string, uint32, string, string, object path). I have the result stored in a GVariant and printing this GVariant shows that there are correct result values…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
2
votes
1 answer

Check if D-Bus object exists

I am currently talking to ConsoleKit with GDBus. I used the ConsoleKit2 XML files and gdbus-codegen to generate the code. Everything is working fine. But how can I check if an object exists? For example I want to see if there is a…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
1 2
3
12 13