MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / SetOpenFileTime

Method SetOpenFileTime

Libraries/unrar/file.cpp:598–619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596
597
598void File::SetOpenFileTime(RarTime *ftm,RarTime *ftc,RarTime *fta)
599{
600#ifdef _WIN_ALL
601 // Workaround for OpenIndiana NAS time bug. If we cannot create a file
602 // in write only mode, we need to flush the write buffer before calling
603 // SetFileTime or file time will not be changed.
604 if (CreateMode!=FMF_UNDEFINED && (CreateMode & FMF_WRITE)==0)
605 FlushFileBuffers(hFile);
606
607 bool sm=ftm!=NULL && ftm->IsSet();
608 bool sc=ftc!=NULL && ftc->IsSet();
609 bool sa=fta!=NULL && fta->IsSet();
610 FILETIME fm,fc,fa;
611 if (sm)
612 ftm->GetWinFT(&fm);
613 if (sc)
614 ftc->GetWinFT(&fc);
615 if (sa)
616 fta->GetWinFT(&fa);
617 SetFileTime(hFile,sc ? &fc:NULL,sa ? &fa:NULL,sm ? &fm:NULL);
618#endif
619}
620
621
622void File::SetCloseFileTime(RarTime *ftm,RarTime *fta)

Callers 2

CreateReparsePointFunction · 0.80
ExtractCurrentFileMethod · 0.80

Calls 2

GetWinFTMethod · 0.80
IsSetMethod · 0.45

Tested by

no test coverage detected