| 542 | |
| 543 | |
| 544 | void File::SetOpenFileTime(RarTime *ftm,RarTime *ftc,RarTime *fta) |
| 545 | { |
| 546 | #ifdef _WIN_ALL |
| 547 | // Workaround for OpenIndiana NAS time bug. If we cannot create a file |
| 548 | // in write only mode, we need to flush the write buffer before calling |
| 549 | // SetFileTime or file time will not be changed. |
| 550 | if (CreateMode!=FMF_UNDEFINED && (CreateMode & FMF_WRITE)==0) |
| 551 | FlushFileBuffers(hFile); |
| 552 | |
| 553 | bool sm=ftm!=NULL && ftm->IsSet(); |
| 554 | bool sc=ftc!=NULL && ftc->IsSet(); |
| 555 | bool sa=fta!=NULL && fta->IsSet(); |
| 556 | FILETIME fm,fc,fa; |
| 557 | if (sm) |
| 558 | ftm->GetWin32(&fm); |
| 559 | if (sc) |
| 560 | ftc->GetWin32(&fc); |
| 561 | if (sa) |
| 562 | fta->GetWin32(&fa); |
| 563 | SetFileTime(hFile,sc ? &fc:NULL,sa ? &fa:NULL,sm ? &fm:NULL); |
| 564 | #endif |
| 565 | } |
| 566 | |
| 567 | |
| 568 | void File::SetCloseFileTime(RarTime *ftm,RarTime *fta) |
no test coverage detected