diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 9e74bafc..eead1790 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -1108,3 +1108,15 @@ bool SGPath::touch() _cached = false; return true; } + +bool SGPath::makeLink(const std::string& destination) +{ + #ifdef SG_WINDOWS + return false; + #else + if (symlink(destination.c_str(), c_str())) { + return false; + } + return true; + #endif +} diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx index 205759a1..2ebfa5b5 100644 --- a/simgear/misc/sg_path.hxx +++ b/simgear/misc/sg_path.hxx @@ -289,6 +289,11 @@ public: */ bool touch(); + /** + * Create a link with this path that points to . + */ + bool makeLink(const std::string& destination); + enum StandardLocation { HOME,