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

Method ExtractFileCopy

Libraries/unrar/extract.cpp:825–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823
824
825bool 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
857void CmdExtract::ExtrPrepareName(Archive &Arc,const wchar *ArcFileName,wchar *DestName,size_t DestSize)

Callers

nothing calls this directly

Calls 7

SlashToNativeFunction · 0.85
uiMsgFunction · 0.85
WaitFunction · 0.85
WOpenMethod · 0.80
WriteMethod · 0.80
ReadMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected