Tag: glib

  • (PSA) GLib can now canonicalize file paths

    Quick announcement: if you have a relative file path, and want to resolve it against another (absolute) path, GLib can do that now. An example in C: g_autofree gchar *path = NULL; g_autofree gchar *another_path = NULL; path = g_canonicalize_filename (“../../usr/bin”, “/etc/foo”); another_path = g_canonicalize_filename (“../../usr/bin”, NULL); g_print (“%s \n”, path); /* Result: “/usr/bin” */…