Index: /trunk/src/lib/nt/nthlp.h
===================================================================
--- /trunk/src/lib/nt/nthlp.h	(revision 3222)
+++ /trunk/src/lib/nt/nthlp.h	(revision 3223)
@@ -54,5 +54,4 @@
 int         birdSetErrnoToBadFileNo(void);
 
-
 HANDLE      birdOpenFile(const char *pszPath, ACCESS_MASK fDesiredAccess, ULONG fFileAttribs,
                          ULONG fShareAccess, ULONG fCreateDisposition, ULONG fCreateOptions, ULONG fObjAttribs);
@@ -74,4 +73,6 @@
 HANDLE      birdOpenCurrentDirectory(void);
 void        birdCloseFile(HANDLE hFile);
+
+int         birdIsPathDirSpec(const char *pszPath);
 int         birdDosToNtPath(const char *pszPath, MY_UNICODE_STRING *pNtPath);
 int         birdDosToNtPathW(const wchar_t *pwszPath, MY_UNICODE_STRING *pNtPath);
Index: /trunk/src/lib/nt/nthlpfs.c
===================================================================
--- /trunk/src/lib/nt/nthlpfs.c	(revision 3222)
+++ /trunk/src/lib/nt/nthlpfs.c	(revision 3223)
@@ -83,5 +83,5 @@
 
 
-static int birdIsPathDirSpec(const char *pszPath)
+int birdIsPathDirSpec(const char *pszPath)
 {
     char ch, ch2;
Index: /trunk/src/lib/nt/ntstat.c
===================================================================
--- /trunk/src/lib/nt/ntstat.c	(revision 3222)
+++ /trunk/src/lib/nt/ntstat.c	(revision 3223)
@@ -955,11 +955,53 @@
 int birdStatModTimeOnly(const char *pszPath, BirdTimeSpec_T *pTimeSpec, int fFollowLink)
 {
-    MY_FILE_BASIC_INFORMATION BasicInfo;
-    int rc = birdStatOnlyInternal(pszPath, fFollowLink, &BasicInfo);
-    if (!rc)
-        birdNtTimeToTimeSpec(BasicInfo.LastWriteTime.QuadPart, pTimeSpec);
-    return rc;
-}
-
-
-
+    /*
+     * Convert the path and call NtQueryFullAttributesFile.
+     *
+     * Note! NtQueryAttributesFile cannot be used as it only returns attributes.
+     */
+    MY_UNICODE_STRING  NtPath;
+
+    birdResolveImports();
+    if (birdDosToNtPath(pszPath, &NtPath) == 0)
+    {
+        MY_OBJECT_ATTRIBUTES                ObjAttr;
+        MY_FILE_NETWORK_OPEN_INFORMATION    Info;
+        MY_NTSTATUS                         rcNt;
+
+        memset(&Info, 0xfe, sizeof(Info));
+
+        MyInitializeObjectAttributes(&ObjAttr, &NtPath, OBJ_CASE_INSENSITIVE, NULL /*hRoot*/, NULL /*pSecAttr*/);
+        rcNt = g_pfnNtQueryFullAttributesFile(&ObjAttr, &Info);
+
+        birdFreeNtPath(&NtPath);
+        if (MY_NT_SUCCESS(rcNt))
+        {
+            birdNtTimeToTimeSpec(Info.LastWriteTime.QuadPart, pTimeSpec);
+
+            /* Do the trailing slash check. */
+            if (   (Info.FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+                || !birdIsPathDirSpec(pszPath))
+            {
+                MY_FILE_BASIC_INFORMATION BasicInfo;
+                if (   !(Info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
+                    || !fFollowLink)
+                    return 0;
+
+                /* Fallback on birdStatOnlyInternal to follow the reparse point.  */
+                if (!birdStatOnlyInternal(pszPath, fFollowLink, &BasicInfo))
+                {
+                    birdNtTimeToTimeSpec(BasicInfo.LastWriteTime.QuadPart, pTimeSpec);
+                    return 0;
+                }
+            }
+            else
+                errno = ENOTDIR;
+        }
+        else
+            birdSetErrnoFromNt(rcNt);
+    }
+    return -1;
+}
+
+
+
Index: /trunk/src/lib/nt/ntstuff.h
===================================================================
--- /trunk/src/lib/nt/ntstuff.h	(revision 3222)
+++ /trunk/src/lib/nt/ntstuff.h	(revision 3223)
@@ -179,4 +179,5 @@
     LARGE_INTEGER   EndOfFile;
     ULONG           FileAttributes;
+    ULONG           AlignmentPadding;
 } MY_FILE_NETWORK_OPEN_INFORMATION;
 
