/ Check-in [46ac1ac2]
Login

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

Overview
Comment:Performance improvement and bug fix in sqlite3WinDelete(). (CVS 3445)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:46ac1ac2d10cf2f1ebfb8dd4bb9a2ccffd85e816
User & Date: drh 2006-09-26 00:34:18
Context
2006-09-26
00:37
Fix to the previous check-in. (CVS 3446) check-in: 944d5f81 user: drh tags: trunk
00:34
Performance improvement and bug fix in sqlite3WinDelete(). (CVS 3445) check-in: 46ac1ac2 user: drh tags: trunk
2006-09-25
18:05
CVS malfunctioned on the previous check-in. Make sure the revision to date.c was received. Ticket #1991. (CVS 3444) check-in: 433dac1f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

491
492
493
494
495
496
497

498
499
500
501
502
503
504
505

506
507
508
509
510
511
512
513
514
515
516
517
int sqlite3WinDelete(const char *zFilename){
  WCHAR *zWide = utf8ToUnicode(zFilename);
  int cnt = 0;
  int rc;
  if( zWide ){
    do{
      rc = DeleteFileW(zWide);

    }while( rc==0 && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
    sqliteFree(zWide);
  }else{
#if OS_WINCE
    return SQLITE_NOMEM;
#else
    do{
      rc = DeleteFileA(zFilename);

    }while( rc==0 && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
#endif
  }
  TRACE2("DELETE \"%s\"\n", zFilename);
  return rc==0 ? SQLITE_OK : SQLITE_IOERR;
}

/*
** Return TRUE if the named file exists.
*/
int sqlite3WinFileExists(const char *zFilename){
  int exists = 0;







>
|







>
|



|







491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
int sqlite3WinDelete(const char *zFilename){
  WCHAR *zWide = utf8ToUnicode(zFilename);
  int cnt = 0;
  int rc;
  if( zWide ){
    do{
      rc = DeleteFileW(zWide);
    }while( rc==0 && GetFileAttributesW(zWide)!=0xffffffff 
            && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
    sqliteFree(zWide);
  }else{
#if OS_WINCE
    return SQLITE_NOMEM;
#else
    do{
      rc = DeleteFileA(zFilename);
    }while( rc==0 && GetFileAttributesA(zFilename)
            && cnt++ < MX_DELETION_ATTEMPTS && (Sleep(100), 1) );
#endif
  }
  TRACE2("DELETE \"%s\"\n", zFilename);
  return rc!=0 ? SQLITE_OK : SQLITE_IOERR;
}

/*
** Return TRUE if the named file exists.
*/
int sqlite3WinFileExists(const char *zFilename){
  int exists = 0;