mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[Support/FileSystem] Introduce llvm::sys::fs::create_symbolic_link().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203136 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -285,6 +285,19 @@ error_code create_hard_link(const Twine &to, const Twine &from) {
|
||||
return error_code::success();
|
||||
}
|
||||
|
||||
error_code create_symbolic_link(const Twine &to, const Twine &from) {
|
||||
// Get arguments.
|
||||
SmallString<128> from_storage;
|
||||
SmallString<128> to_storage;
|
||||
StringRef f = from.toNullTerminatedStringRef(from_storage);
|
||||
StringRef t = to.toNullTerminatedStringRef(to_storage);
|
||||
|
||||
if (::symlink(t.begin(), f.begin()) == -1)
|
||||
return error_code(errno, system_category());
|
||||
|
||||
return error_code::success();
|
||||
}
|
||||
|
||||
error_code remove(const Twine &path, bool IgnoreNonExisting) {
|
||||
SmallString<128> path_storage;
|
||||
StringRef p = path.toNullTerminatedStringRef(path_storage);
|
||||
|
Reference in New Issue
Block a user