[llvm-commits] [llvm] r118681 - /llvm/trunk/lib/System/Win32/Path.inc

Michael J. Spencer bigcheesegs at gmail.com
Wed Nov 10 07:05:39 PST 2010


Author: mspencer
Date: Wed Nov 10 09:05:39 2010
New Revision: 118681

URL: http://llvm.org/viewvc/llvm-project?rev=118681&view=rev
Log:
System/Win32/Path: Implement isSymLink.

Modified:
    llvm/trunk/lib/System/Win32/Path.inc

Modified: llvm/trunk/lib/System/Win32/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=118681&r1=118680&r2=118681&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Path.inc (original)
+++ llvm/trunk/lib/System/Win32/Path.inc Wed Nov 10 09:05:39 2010
@@ -376,7 +376,15 @@
 
 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





More information about the llvm-commits mailing list