Diff of /main/trunk/interpreter/platform/windows/SysFileSystem.cpp [r5034] .. [r5035] Maximize Restore

  Switch to side-by-side view

--- a/main/trunk/interpreter/platform/windows/SysFileSystem.cpp
+++ b/main/trunk/interpreter/platform/windows/SysFileSystem.cpp
@@ -606,7 +606,7 @@
 bool SysFileSystem::isFile(const char *name)
 {
     DWORD dwAttrs = GetFileAttributes(name);
-    return (dwAttrs != 0xffffffff) && (dwAttrs & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT)) != 0;
+    return (dwAttrs != 0xffffffff) && (dwAttrs & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT)) == 0;
 }
 
 
@@ -652,7 +652,7 @@
     * Search MSDN for 'Converting a time_t Value to a File Time' for following implementation.
     */
     int64_t tempResult = ((int64_t) lastWriteTime.dwHighDateTime << (int64_t)32) | (int64_t) lastWriteTime.dwLowDateTime;
-    int64_t result = (tempResult - 116444736000000000) / 10000;
+    int64_t result = (tempResult - 116444736000000000) / 10;
 
     CloseHandle(newHandle);
     return result;
@@ -758,7 +758,7 @@
     }
 
     // convert back to a file time
-    int64_t temp = (time * (int64_t)10000) + 116444736000000000;
+    int64_t temp = (time * (int64_t)1000) + 116444736000000000;
 
     fileTime.dwHighDateTime = (DWORD)(temp >> 32);
     fileTime.dwLowDateTime = (DWORD)temp;
@@ -800,6 +800,43 @@
 
 
 /**
+ * Retrieve the file system root elements.  On Windows,
+ * each of the drives is a root element.
+ *
+ * @return The number of roots located.
+ */
+int SysFileSystem::getRoots(char *roots)
+{
+    int length = GetLogicalDriveStrings(MAX_PATH, roots);
+    // elements are returned in the form "d:\", with a null
+    // separator.  Each root thus takes up 4 characters
+    return length / 4;
+}
+
+
+/**
+ * Return the separator used for separating path names.
+ *
+ * @return The ASCII-Z version of the path separator.
+ */
+const char *SysFileSystem::getSeparator()
+{
+    return "\\";
+}
+
+
+/**
+ * Return the separator used for separating search path elements
+ *
+ * @return The ASCII-Z version of the path separator.
+ */
+const char *SysFileSystem::getPathSeparator()
+{
+    return ";";
+}
+
+
+/**
  * Create a new SysFileIterator instance.
  *
  * @param p      The directory we're iterating over.
@@ -811,7 +848,7 @@
     // save the pattern and convert into a wild card
     // search
     strncpy(pattern, p, sizeof(pattern));
-    strncat(pattern, "*", sizeof(pattern));
+    strncat(pattern, "\\*", sizeof(pattern));
 
     // this assumes we'll fail...if we find something,
     // we'll flip this
@@ -883,3 +920,5 @@
     }
 }
 
+
+