| 823 | |
| 824 | |
| 825 | bool CmdExtract::ExtractFileCopy(File &New,wchar *ArcName,wchar *NameNew,wchar *NameExisting,size_t NameExistingSize) |
| 826 | { |
| 827 | SlashToNative(NameExisting,NameExisting,NameExistingSize); // Not needed for RAR 5.1+ archives. |
| 828 | |
| 829 | File Existing; |
| 830 | if (!Existing.WOpen(NameExisting)) |
| 831 | { |
| 832 | uiMsg(UIERROR_FILECOPY,ArcName,NameExisting,NameNew); |
| 833 | uiMsg(UIERROR_FILECOPYHINT,ArcName); |
| 834 | #ifdef RARDLL |
| 835 | Cmd->DllError=ERAR_EREFERENCE; |
| 836 | #endif |
| 837 | return false; |
| 838 | } |
| 839 | |
| 840 | Array<char> Buffer(0x100000); |
| 841 | int64 CopySize=0; |
| 842 | |
| 843 | while (true) |
| 844 | { |
| 845 | Wait(); |
| 846 | int ReadSize=Existing.Read(&Buffer[0],Buffer.Size()); |
| 847 | if (ReadSize==0) |
| 848 | break; |
| 849 | New.Write(&Buffer[0],ReadSize); |
| 850 | CopySize+=ReadSize; |
| 851 | } |
| 852 | |
| 853 | return true; |
| 854 | } |
| 855 | |
| 856 | |
| 857 | void CmdExtract::ExtrPrepareName(Archive &Arc,const wchar *ArcFileName,wchar *DestName,size_t DestSize) |