aboutsummaryrefslogtreecommitdiffstats
path: root/lib/System/Win32
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-29 17:00:31 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-29 17:00:31 +0000
commit4031befb62d90309bdaa3c9cbed9c0b5fc12d67c (patch)
tree101092da49b0a1bc75de6e57aaaed1e90f904c09 /lib/System/Win32
parenta5cb38980b444754196f298c0645a99069fd3c9b (diff)
downloadexternal_llvm-4031befb62d90309bdaa3c9cbed9c0b5fc12d67c.zip
external_llvm-4031befb62d90309bdaa3c9cbed9c0b5fc12d67c.tar.gz
external_llvm-4031befb62d90309bdaa3c9cbed9c0b5fc12d67c.tar.bz2
Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The windows case needs to be improved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32')
-rw-r--r--lib/System/Win32/Path.inc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc
index 1f809ec..f5edaa0 100644
--- a/lib/System/Win32/Path.inc
+++ b/lib/System/Win32/Path.inc
@@ -319,6 +319,13 @@ Path::getFileStatus(FileStatus &info, bool update, std::string *ErrStr) const {
status->user = 9999; // Not applicable to Windows, so...
status->group = 9999; // Not applicable to Windows, so...
+ // FIXME: this is only unique if the file is accessed by the same file path.
+ // How do we do this for C:\dir\file and ..\dir\file ? Unix has inode
+ // numbers, but the concept doesn't exist in Windows.
+ status->uniqueID = 0;
+ for (unsigned i = 0; i < path.length(); ++i)
+ status->uniqueID += path[i];
+
__int64 ft = *reinterpret_cast<__int64*>(&fi.ftLastWriteTime);
status->modTime.fromWin32Time(ft);