about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 740d767a4ea6..b264fc5f3d13 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -386,6 +386,13 @@ Paths createDirs(const Path & path)
 }
 
 
+void createSymlink(const Path & target, const Path & link)
+{
+    if (symlink(target.c_str(), link.c_str()))
+        throw SysError(format("creating symlink from `%1%' to `%2%'") % link % target);
+}
+
+
 LogType logType = ltPretty;
 Verbosity verbosity = lvlInfo;