Changeset 7370 in vbox
- Timestamp:
- Mar 7, 2008 2:46:00 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/file.h
r7340 r7370 343 343 * @{ */ 344 344 /** Do not use RTFILE_O_DENY_WRITE on the source file to allow for copying files opened for writing. */ 345 #define RTFILECOPY_FLAG_NO_DENY_WRITE 0x0001 345 #define RTFILECOPY_FLAGS_NO_SRC_DENY_WRITE RT_BIT(0) 346 /** Do not use RTFILE_O_DENY_WRITE on the target file. */ 347 #define RTFILECOPY_FLAGS_NO_DST_DENY_WRITE RT_BIT(1) 348 /** Do not use RTFILE_O_DENY_WRITE on either of the two file. */ 349 #define RTFILECOPY_FLAGS_NO_DENY_WRITE ( RTFILECOPY_FLAGS_NO_SRC_DENY_WRITE | RTFILECOPY_FLAGS_NO_DST_DENY_WRITE ) 350 /** */ 351 #define RTFILECOPY_FLAGS_MASK UINT32_C(0x00000003) 346 352 /** @} */ 347 353 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r7349 r7370 4317 4317 Utf8Str nf = Utf8StrFmt ("%s.%s.bak", of.raw(), aOldFormat.raw()); 4318 4318 4319 int vrc = RTFileCopyEx (of, nf, RTFILECOPY_FLAG _NO_DENY_WRITE,4319 int vrc = RTFileCopyEx (of, nf, RTFILECOPY_FLAGS_NO_SRC_DENY_WRITE, 4320 4320 NULL, NULL); 4321 4321 … … 4327 4327 { 4328 4328 nf = Utf8StrFmt ("%s.%d", tmp.raw(), i); 4329 vrc = RTFileCopyEx (of, nf, RTFILECOPY_FLAG _NO_DENY_WRITE,4329 vrc = RTFileCopyEx (of, nf, RTFILECOPY_FLAGS_NO_SRC_DENY_WRITE, 4330 4330 NULL, NULL); 4331 4331 } -
trunk/src/VBox/Runtime/r3/fileio.cpp
r7340 r7370 327 327 AssertMsgReturn(*pszDst, ("pszDst=%p\n", pszDst), VERR_INVALID_PARAMETER); 328 328 AssertMsgReturn(!pfnProgress || VALID_PTR(pfnProgress), ("pfnProgress=%p\n", pfnProgress), VERR_INVALID_PARAMETER); 329 AssertMsgReturn(!(fFlags & ~RTFILECOPY_FLAGS_MASK), ("%#x\n", fFlags), VERR_INVALID_PARAMETER); 329 330 330 331 /* … … 332 333 */ 333 334 RTFILE FileSrc; 334 uint32_t fSrcOpen = RTFILE_O_READ | RTFILE_O_OPEN; 335 if (!(fFlags & RTFILECOPY_FLAG_NO_DENY_WRITE)) 336 fSrcOpen |= RTFILE_O_DENY_WRITE; 337 int rc = RTFileOpen(&FileSrc, pszSrc, fSrcOpen); 335 int rc = RTFileOpen(&FileSrc, pszSrc, 336 RTFILE_O_READ | (fFlags & RTFILECOPY_FLAGS_NO_SRC_DENY_WRITE ? 0 : RTFILE_O_DENY_WRITE) | RTFILE_O_OPEN); 338 337 if (RT_SUCCESS(rc)) 339 338 { 340 339 RTFILE FileDst; 341 rc = RTFileOpen(&FileDst, pszDst, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE); 340 rc = RTFileOpen(&FileDst, pszDst, 341 RTFILE_O_READ | (fFlags & RTFILECOPY_FLAGS_NO_DST_DENY_WRITE ? 0 : RTFILE_O_DENY_WRITE) | RTFILE_O_OPEN); 342 342 if (RT_SUCCESS(rc)) 343 343 {
Note:
See TracChangeset
for help on using the changeset viewer.