+/**
+ * a_file_export_babel:
+ */
+gboolean a_file_export_babel ( VikTrwLayer *vtl, const gchar *filename, const gchar *format,
+ gboolean tracks, gboolean routes, gboolean waypoints )
+{
+ gchar *args = g_strdup_printf("%s %s %s -o %s",
+ tracks ? "-t" : "",
+ routes ? "-r" : "",
+ waypoints ? "-w" : "",
+ format);
+ gboolean result = a_babel_convert_to ( vtl, NULL, args, filename, NULL, NULL );
+ g_free(args);
+ return result;
+}
+
+/**
+ * Just a wrapper around realpath, which itself is platform dependent
+ */
+char *file_realpath ( const char *path, char *real )
+{
+ return realpath ( path, real );
+}
+
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+/**
+ * Always return the canonical filename in a newly allocated string
+ */
+char *file_realpath_dup ( const char *path )
+{
+ char real[MAXPATHLEN];
+
+ g_return_val_if_fail(path != NULL, NULL);
+
+ if (file_realpath(path, real))
+ return g_strdup(real);
+
+ return g_strdup(path);
+}
+
+/**
+ * Permission granted to use this code after personal correspondance
+ * Slightly reworked for better cross platform use, glibisms, function rename and a compacter format
+ *
+ * FROM http://www.codeguru.com/cpp/misc/misc/fileanddirectorynaming/article.php/c263
+ */
+
+// GetRelativeFilename(), by Rob Fisher.
+// rfisher@iee.org
+// http://come.to/robfisher
+
+// The number of characters at the start of an absolute filename. e.g. in DOS,
+// absolute filenames start with "X:\" so this value should be 3, in UNIX they start
+// with "\" so this value should be 1.
+#ifdef WINDOWS
+#define ABSOLUTE_NAME_START 3
+#else
+#define ABSOLUTE_NAME_START 1
+#endif
+
+// Given the absolute current directory and an absolute file name, returns a relative file name.
+// For example, if the current directory is C:\foo\bar and the filename C:\foo\whee\text.txt is given,
+// GetRelativeFilename will return ..\whee\text.txt.
+
+const gchar *file_GetRelativeFilename ( gchar *currentDirectory, gchar *absoluteFilename )