/ Check-in [ec35f254]
Login

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

Overview
Comment:Modify the VFS xAccess() method on winNT so that it returns false for an exists test of a zero-length file. This makes the windows VFS work the same as the unix VFS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ec35f25403744f7441ac5ae1486b84d8ebc13e98
User & Date: drh 2010-07-05 21:00:43
Context
2010-07-06
07:36
Ensure the correct error code is returned if an attempt to parse a database schema made by an ATTACH statement fails. check-in: c2721961 user: dan tags: trunk
2010-07-05
21:00
Modify the VFS xAccess() method on winNT so that it returns false for an exists test of a zero-length file. This makes the windows VFS work the same as the unix VFS. check-in: ec35f254 user: drh tags: trunk
19:13
Simplify the previous commit by removing the pagerCheckForOrDeleteWAL() wrapper. check-in: a1324d12 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

2074
2075
2076
2077
2078
2079
2080


2081








2082
2083
2084
2085
2086
2087
2088
  int rc = 0;
  void *zConverted = convertUtf8Filename(zFilename);
  UNUSED_PARAMETER(pVfs);
  if( zConverted==0 ){
    return SQLITE_NOMEM;
  }
  if( isNT() ){


    attr = GetFileAttributesW((WCHAR*)zConverted);








/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. 
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
  }else{
    attr = GetFileAttributesA((char*)zConverted);







>
>
|
>
>
>
>
>
>
>
>







2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
  int rc = 0;
  void *zConverted = convertUtf8Filename(zFilename);
  UNUSED_PARAMETER(pVfs);
  if( zConverted==0 ){
    return SQLITE_NOMEM;
  }
  if( isNT() ){
    WIN32_FILE_ATTRIBUTE_DATA sAttrData;
    memset(&sAttrData, 0, sizeof(sAttrData));
    attr = GetFileAttributesExW((WCHAR*)zConverted,
                               GetFileExInfoStandard, &sAttrData);
    /* For an SQLITE_ACCESS_EXISTS query, treat a zero-length file
    ** as if it does not exist.
    */
    if( flags==SQLITE_ACCESS_EXISTS && attr!=INVALID_FILE_ATTRIBUTES
        && sAttrData.nFileSizeHigh==0 && sAttrData.nFileSizeLow==0 ){
            attr = INVALID_FILE_ATTRIBUTES;
    }
/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. 
** Since the ASCII version of these Windows API do not exist for WINCE,
** it's important to not reference them for WINCE builds.
*/
#if SQLITE_OS_WINCE==0
  }else{
    attr = GetFileAttributesA((char*)zConverted);