| 634 | |
| 635 | |
| 636 | void File::SetCloseFileTimeByName(const wchar *Name,RarTime *ftm,RarTime *fta) |
| 637 | { |
| 638 | #ifdef _UNIX |
| 639 | bool setm=ftm!=NULL && ftm->IsSet(); |
| 640 | bool seta=fta!=NULL && fta->IsSet(); |
| 641 | if (setm || seta) |
| 642 | { |
| 643 | char NameA[NM]; |
| 644 | WideToChar(Name,NameA,ASIZE(NameA)); |
| 645 | |
| 646 | #ifdef UNIX_TIME_NS |
| 647 | timespec times[2]; |
| 648 | times[0].tv_sec=seta ? fta->GetUnix() : 0; |
| 649 | times[0].tv_nsec=seta ? long(fta->GetUnixNS()%1000000000) : UTIME_NOW; |
| 650 | times[1].tv_sec=setm ? ftm->GetUnix() : 0; |
| 651 | times[1].tv_nsec=setm ? long(ftm->GetUnixNS()%1000000000) : UTIME_NOW; |
| 652 | utimensat(AT_FDCWD,NameA,times,0); |
| 653 | #else |
| 654 | utimbuf ut; |
| 655 | if (setm) |
| 656 | ut.modtime=ftm->GetUnix(); |
| 657 | else |
| 658 | ut.modtime=fta->GetUnix(); // Need to set something, cannot left it 0. |
| 659 | if (seta) |
| 660 | ut.actime=fta->GetUnix(); |
| 661 | else |
| 662 | ut.actime=ut.modtime; // Need to set something, cannot left it 0. |
| 663 | utime(NameA,&ut); |
| 664 | #endif |
| 665 | } |
| 666 | #endif |
| 667 | } |
| 668 | |
| 669 | |
| 670 | void File::GetOpenFileTime(RarTime *ft) |
nothing calls this directly
no test coverage detected