8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 04:03:03 +01:00

I see no explicit need to emulate POSIX semantics and allow shared deletes.

This commit is contained in:
dimitr 2006-06-14 14:42:16 +00:00
parent 0e5d864db2
commit 6b69bc673f

View File

@ -289,7 +289,7 @@ void nbackup::open_database_write()
{
#ifdef WIN_NT
dbase = CreateFile(dbname.c_str(), GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (dbase == INVALID_HANDLE_VALUE)
b_error::raise("Error (%d) opening database file: %s", GetLastError(), dbname.c_str());
@ -310,8 +310,8 @@ void nbackup::open_database_scan()
// and OS itself. Basically, reading any large file brings the whole system
// down for extended period of time. Documented workaround is to avoid using
// system cache when reading large files.
dbase = CreateFile(dbname.c_str(),
GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
dbase = CreateFile(dbname.c_str(), GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_NO_BUFFERING,
NULL);
if (dbase == INVALID_HANDLE_VALUE)
@ -326,7 +326,7 @@ void nbackup::open_database_scan()
void nbackup::create_database()
{
#ifdef WIN_NT
dbase = CreateFile(dbname.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_DELETE,
dbase = CreateFile(dbname.c_str(), GENERIC_READ | GENERIC_WRITE, 0,
NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (dbase == INVALID_HANDLE_VALUE)
b_error::raise("Error (%d) creating database file: %s", GetLastError(), dbname.c_str());
@ -367,7 +367,7 @@ void nbackup::create_backup()
backup = GetStdHandle(STD_OUTPUT_HANDLE);
}
else {
backup = CreateFile(bakname.c_str(), GENERIC_WRITE, FILE_SHARE_DELETE,
backup = CreateFile(bakname.c_str(), GENERIC_WRITE, 0,
NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
}
if (backup == INVALID_HANDLE_VALUE)