/ 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 Unified Diffs Ignore Whitespace Patch

Changes to ext/misc/fileio.c.

276
277
278
279
280
281
282
283

284
285
286
287
288
289
290
    HANDLE hFile;
    GetSystemTime(&currentTime);
    SystemTimeToFileTime(&currentTime, &lastAccess);
    intervals = Int32x32To64(mtime, 10000000) + 116444736000000000;
    lastWrite.dwLowDateTime = (DWORD)intervals;
    lastWrite.dwHighDateTime = intervals >> 32;
    hFile = CreateFile(
      zFile, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING, 0, NULL

    );
    if( hFile!=INVALID_HANDLE_VALUE ){
      BOOL bResult = SetFileTime(hFile, NULL, &lastAccess, &lastWrite);
      CloseHandle(hFile);
      return !bResult;
    }else{
      return 1;







|
>







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