Re: Getting well-known-name from unique-name?

Lawrence D'Oliveiro <ldo-kC51rjc0cqs1dNLGKZg6taU/[email protected]>
Newsgroups gmane.comp.freedesktop.dbus
Organization Geek Central
Message-ID <[email protected]>
On Tue, 26 Feb 2019 10:13:06 -0500, Fabián Orccón wrote:

> Is there a way or some hack to get a well-known-name from a
> unique-name? I saw that there is a org.freedesktop.DBus.GetNameOwner
> but this gets the unique-name from a well-known name.

The only way I can think of is to list all the names on the bus, and
when you see a well-known name, use GetNameOwner to look for the unique
name that it maps to. Basically you build your own inverse mapping
table, then see what entry or entries match the unique name you are
interested in.

This example script
<https://github.com/ldo/dbussy_examples/blob/master/list_bus_names>
may be helpful: it can list the owners of all well-known names on a
bus, using e.g.

    list_bus_names --owners session
_______________________________________________
dbus mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dbus
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.