On Mon, 22 Jul 2019, Artur Tarassow wrote:
> Hi Allin and Jack,
>
> Often one works, at least me, on different machines which may have
> different directory structures; something like
>
> <hansl>
> scalar MACHINE = 1
> if MACHINE==1
> string wd = "home/user_b/Dropbox/project/"
> elif MACHINE==2
> string wd = "home/user_B/SomStuff/project/"
> endif
> </hansl>
>
> This requires that one always need to select manually some active
> machine. Linux (and I guess also Windows and MacOS), however, stores a
> unique identifier for every machine, try <cat /etc/machine-id>. See
> e.g. here for details:
>
http://man7.org/linux/man-pages/man5/machine-id.5.html
>
> Do you also consider it worthy to add such an accessor which could be
> named "idmachine". Alternatively it could be stored in the bundle
> accessed by $sysinfo.
I don't think this is portable. You can google to find lots of
inconclusive discussion of how to find a unique machine ID on Windows.
However, we already report as the "hostname" member of $sysinfo whatever
the GLib function g_get_host_name() returns, and it seems that should
probably be adequate for the purpose you have in mind.
Ah, ok. Good idea, Allin. This is sufficient for my case ;-)
Best,
Artur