-#ifdef __WXWINCE__
- DWORD access = 0;
- DWORD shareMode = 0;
- DWORD disposition = 0;
-
- int flags = O_BINARY;
-
- switch ( mode )
- {
- case read:
- access = GENERIC_READ;
- shareMode = FILE_SHARE_READ|FILE_SHARE_WRITE;
- disposition = OPEN_EXISTING;
- break;
-
- case write_append:
- if ( wxFile::Exists(szFileName) )
- {
- access = GENERIC_READ|GENERIC_WRITE;
- shareMode = FILE_SHARE_READ;
- disposition = 0;
- break;
- }
- //else: fall through as write_append is the same as write if the
- // file doesn't exist
-
- case write:
- access = GENERIC_WRITE;
- shareMode = 0;
- disposition = TRUNCATE_EXISTING;
- break;
-
- case write_excl:
- access = GENERIC_WRITE;
- shareMode = 0;
- disposition = TRUNCATE_EXISTING;
- break;
-
- case read_write:
- access = GENERIC_READ|GENERIC_WRITE;
- shareMode = 0;
- disposition = 0;
- break;
- }
-
- int fd = 0;
- HANDLE fileHandle = ::CreateFile(szFileName, access, shareMode, NULL,
- disposition, FILE_ATTRIBUTE_NORMAL, 0);
- if (fileHandle == INVALID_HANDLE_VALUE)
- fd = -1;
- else
- fd = (int) fileHandle;
-#else