diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c index ce36c7788f..4dc60184d9 100644 --- a/programs/cmm/TWB/TWB.c +++ b/programs/cmm/TWB/TWB.c @@ -296,7 +296,6 @@ void TWebBrowser::SetStyle() { } if (opened) { if (strcmp(#header, #version) != 0) { - debugln("!!!!!!!!!!!!!!!!!!!!!!"); ChangeCharset(charsets[cur_encoding], "CP866", #header); sprintf(#header, "%s - %s", #header, #version); } diff --git a/programs/cmm/eolite/include/copy.h b/programs/cmm/eolite/include/copy.h index 1a12ff6d04..476d62583f 100644 --- a/programs/cmm/eolite/include/copy.h +++ b/programs/cmm/eolite/include/copy.h @@ -57,6 +57,7 @@ void Copy(dword pcth, char cut) } void Paste() { + copy_stak = free(copy_stak); copy_stak = malloc(64000); CreateThread(#PasteThread,copy_stak+64000-4); } diff --git a/programs/cmm/eolite/include/left_panel.h b/programs/cmm/eolite/include/left_panel.h index 9e097075b3..c90c9fec32 100644 --- a/programs/cmm/eolite/include/left_panel.h +++ b/programs/cmm/eolite/include/left_panel.h @@ -33,9 +33,9 @@ ?define T_CD "CD-ROM " ?define T_FD "Floppy disk " ?define T_HD "Hard disk " - ?define T_SATA "SATA disk" - ?define T_USB "USB disk" - ?define T_RAM "RAM disk" + ?define T_SATA "SATA disk " + ?define T_USB "USB disk " + ?define T_RAM "RAM disk " #endif struct _SystemDiscs diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index bac43ecc4f..4a4ad45ced 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -1,5 +1,5 @@ -#define TITLE "Eolite File Manager v3.83" -#define ABOUT_TITLE "EOLITE 3.83" +#define TITLE "Eolite File Manager v3.85" +#define ABOUT_TITLE "EOLITE 3.85" #ifdef LANG_RUS ?define T_FILE "” ©«" diff --git a/programs/cmm/lib/copyf.h b/programs/cmm/lib/copyf.h index d0a0b29a1d..17cb261007 100644 --- a/programs/cmm/lib/copyf.h +++ b/programs/cmm/lib/copyf.h @@ -14,9 +14,7 @@ if (!from1) || (!in1) { - notify("Error: too less copyf params!"); - notify(from1); - notify(in1); + notify("Error: too few copyf() params!"); return; } if (error = GetFileInfo(from1, #CopyFile_atr1)) @@ -28,7 +26,7 @@ return CopyFolder(from1, in1); else { - Operation_Draw_Progress(from1+strchr(from1, '/')); + Operation_Draw_Progress(from1+strrchr(from1, '/')); return CopyFile(from1, in1); } } @@ -37,27 +35,24 @@ { BDVK CopyFile_atr; dword error, cbuf; + dword block; + if (error = GetFileInfo(copy_from3, #CopyFile_atr)) { debugln("Error: CopyFile->GetFileInfo"); } - else if (GetFreeRAM()-1024*1024 < CopyFile_atr.sizelo) //GetFreeRam-1Mb and convert to bytes + else { - debugln("Error: CopyFile->File size is bigger than RAM avilable"); - error = 30; - } - else { - cbuf = malloc(CopyFile_atr.sizelo); - if (error = ReadFile(0, CopyFile_atr.sizelo, cbuf, copy_from3)) + if (GetFreeRAM()-1024*1024 < CopyFile_atr.sizelo) //GetFreeRam-1Mb and convert to bytes { - debugln("Error: CopyFile->ReadFile"); - } - else - { - if (error = WriteFile(CopyFile_atr.sizelo, cbuf, copy_in3)) debugln("Error: CopyFile->WriteFile"); + if (error = CopyFileByBlocks(CopyFile_atr.sizelo, copy_from3, copy_in3)) + debugln("Error: CopyFile->CopyFileByBlocks"); } + else { + if (error = CopyFileAtOnce(CopyFile_atr.sizelo, copy_from3, copy_in3)) + debugln("Error: CopyFile->CopyFileAtOnce"); + } } - free(cbuf); if (error) debug_error(copy_from3, error); return error; } @@ -96,7 +91,7 @@ } else { - Operation_Draw_Progress(filename+strchr(filename, '/')); + Operation_Draw_Progress(filename+strrchr(filename, '/')); if (error=CopyFile(#copy_from2, #copy_in2)) { if (fabs(error)==8) { debugln("Stop copying."); break;} //TODO: may be need grobal var like stop_all diff --git a/programs/cmm/lib/file_system.h b/programs/cmm/lib/file_system.h index a557f57b21..6d2b7478c7 100644 --- a/programs/cmm/lib/file_system.h +++ b/programs/cmm/lib/file_system.h @@ -129,33 +129,30 @@ // Прочитать файл // //////////////////////////// :f70 read_file_70; -:int ReadFile(dword read_pos, read_file_size, read_buffer, read_file_path) +:int ReadFile(dword offset, data_size, buffer, file_path) { read_file_70.func = 0; - read_file_70.param1 = read_pos; + read_file_70.param1 = offset; read_file_70.param2 = 0; - read_file_70.param3 = read_file_size; - read_file_70.param4 = read_buffer; + read_file_70.param3 = data_size; + read_file_70.param4 = buffer; read_file_70.rezerv = 0; - read_file_70.name = read_file_path; + read_file_70.name = file_path; $mov eax,70 $mov ebx,#read_file_70.func $int 0x40 } - /////////////////////////// - // Записать файл // -/////////////////////////// :f70 write_file_70; -:int WriteFile(dword write_file_size, write_buffer, write_file_path) +:int WriteFile(dword data_size, buffer, file_path) { write_file_70.func = 2; write_file_70.param1 = 0; write_file_70.param2 = 0; - write_file_70.param3 = write_file_size; - write_file_70.param4 = write_buffer; + write_file_70.param3 = data_size; + write_file_70.param4 = buffer; write_file_70.rezerv = 0; - write_file_70.name = write_file_path; + write_file_70.name = file_path; $mov eax,70 $mov ebx,#write_file_70.func $int 0x40 @@ -165,19 +162,20 @@ // WriteInFileThatAlredyExists // //////////////////////////////////////// :f70 write_file_offset_70; -:int WriteFileWithOffset(dword write_data_size, write_buffer, write_file_path, offset) +:int WriteFileWithOffset(dword offset, data_size, buffer, file_path) { write_file_offset_70.func = 3; write_file_offset_70.param1 = offset; write_file_offset_70.param2 = 0; - write_file_offset_70.param3 = write_data_size; - write_file_offset_70.param4 = write_buffer; + write_file_offset_70.param3 = data_size; + write_file_offset_70.param4 = buffer; write_file_offset_70.rezerv = 0; - write_file_offset_70.name = write_file_path; + write_file_offset_70.name = file_path; $mov eax,70 $mov ebx,#write_file_offset_70.func $int 0x40 -} +} + /////////////////////////// // Прочитать папку // @@ -346,4 +344,47 @@ enum return #size; } + +:int CopyFileAtOnce(dword size, copyFrom, copyTo) +dword cbuf; +int error; +{ + cbuf = malloc(size); + if (error = ReadFile(0, size, cbuf, copyFrom)) + { + debugln("Error: CopyFileAtOnce->ReadFile"); + } + else + { + if (error = WriteFile(size, cbuf, copyTo)) debugln("Error: CopyFileAtOnce->WriteFile"); + } + free(cbuf); + return error; +} + +:int CopyFileByBlocks(dword size, copyFrom, copyTo) +dword cbuf; +int error=-1; +dword offpos=0; +int block_size=1024*4024; //copy by 4 MiBs +{ + cbuf = malloc(block_size); + WriteFile(0, 0, copyTo); //create file + while(offpos < size) + { + error = ReadFile(offpos, block_size, cbuf, copyFrom); + if (error = 6) { //File ended before last byte was readed + block_size = EBX; + error=0; + } + else + if (error!=0) break; + if (error = WriteFileWithOffset(offpos, block_size, cbuf, copyTo)) break; + offpos += block_size; + } + free(cbuf); + return error; +} + + #endif \ No newline at end of file