MCPcopy Create free account
hub / github.com/ararog/Unrar4iOS / SetOpenFileTime

Method SetOpenFileTime

Unrar4iOS/unrar/file.cpp:544–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542
543
544void 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
568void File::SetCloseFileTime(RarTime *ftm,RarTime *fta)

Callers 1

extract.cppFile · 0.80

Calls 2

GetWin32Method · 0.80
IsSetMethod · 0.45

Tested by

no test coverage detected