simgear/misc/sg_path.*: added SGPath::makeLink(), for making softlinks.
Note that on Windows there is no implementation yet and it always returns false.
This commit is contained in:
@@ -1108,3 +1108,15 @@ bool SGPath::touch()
|
|||||||
_cached = false;
|
_cached = false;
|
||||||
return true;
|
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
|
||||||
|
}
|
||||||
|
|||||||
@@ -289,6 +289,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool touch();
|
bool touch();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a link with this path that points to <destination>.
|
||||||
|
*/
|
||||||
|
bool makeLink(const std::string& destination);
|
||||||
|
|
||||||
enum StandardLocation
|
enum StandardLocation
|
||||||
{
|
{
|
||||||
HOME,
|
HOME,
|
||||||
|
|||||||
Reference in New Issue
Block a user