summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-11-10 15:05:39 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-11-10 15:05:39 +0000
commit339b9121bd229fdb6a376ada16285e2a0cc36706 (patch)
treed303e6ec642c80814528967ddd70fc2c0354be27
parentb2cbdc35ba85c04df15b0e991d9be371691ab08c (diff)
downloadllvm-339b9121bd229fdb6a376ada16285e2a0cc36706.tar.gz
llvm-339b9121bd229fdb6a376ada16285e2a0cc36706.tar.bz2
llvm-339b9121bd229fdb6a376ada16285e2a0cc36706.tar.xz
System/Win32/Path: Implement isSymLink.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118681 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/System/Win32/Path.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 4760dfd93d..66e50acaea 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -376,7 +376,15 @@ Path::isDirectory() const {
bool
Path::isSymLink() const {
- return false;
+ DWORD attributes = GetFileAttributes(path.c_str());
+
+ if (attributes == INVALID_FILE_ATTRIBUTES)
+ // There's no sane way to report this :(.
+ assert(0 && "GetFileAttributes returned INVALID_FILE_ATTRIBUTES");
+
+ // This isn't exactly what defines a NTFS symlink, but it is only true for
+ // paths that act like a symlink.
+ return attributes & FILE_ATTRIBUTE_REPARSE_POINT;
}
bool