/ Check-in [4f344406]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the 'fileio' extension code for Win32, use the FILE_FLAG_BACKUP_SEMANTICS flag when setting the file times, just in case the file is actually a directory.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sqlar-shell-support
Files: files | file ages | folders
SHA3-256: 4f3444060057127bce81787ed83cb5225cdbdd577596bc3fb06a40be2208f238
User & Date: mistachkin 2018-01-04 23:49:08
Context
2018-01-05
00:53
Add missing #ifdef. check-in: a0e18aea user: mistachkin tags: sqlar-shell-support
2018-01-04
23:49
In the 'fileio' extension code for Win32, use the FILE_FLAG_BACKUP_SEMANTICS flag when setting the file times, just in case the file is actually a directory. check-in: 4f344406 user: mistachkin tags: sqlar-shell-support
22:50
Remove 'timespec' related code from the shell that has no effect and a (now) superfluous 'timespec' typedef from the Win32 dirent header file. check-in: 57dac995 user: mistachkin tags: sqlar-shell-support
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/fileio.c.

   276    276       HANDLE hFile;
   277    277       GetSystemTime(&currentTime);
   278    278       SystemTimeToFileTime(&currentTime, &lastAccess);
   279    279       intervals = Int32x32To64(mtime, 10000000) + 116444736000000000;
   280    280       lastWrite.dwLowDateTime = (DWORD)intervals;
   281    281       lastWrite.dwHighDateTime = intervals >> 32;
   282    282       hFile = CreateFile(
   283         -      zFile, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING, 0, NULL
          283  +      zFile, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING,
          284  +      FILE_FLAG_BACKUP_SEMANTICS, NULL
   284    285       );
   285    286       if( hFile!=INVALID_HANDLE_VALUE ){
   286    287         BOOL bResult = SetFileTime(hFile, NULL, &lastAccess, &lastWrite);
   287    288         CloseHandle(hFile);
   288    289         return !bResult;
   289    290       }else{
   290    291         return 1;