better cp, 64-bit fileops

git-svn-id: svn://kolibrios.org@6857 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl
2017-02-06 12:35:58 +00:00
parent d248870812
commit 4e23975970
17 changed files with 107 additions and 104 deletions
@@ -359,7 +359,7 @@ for (i = 0; i < NUM_OF_CMD; i++)
if (!strcmp(cmd, COMMANDS[i].name))
{
result = ((handler1_t)COMMANDS[i].handler)(args);
if (result != TRUE)
if (result == FALSE)
{
#if LANG_ENG
printf(" Error!\n\r");
@@ -6,7 +6,8 @@ kol_struct70 k70;
k70.p00 = 7;
k70.p04 = 0;
k70.p08 = (unsigned) param;
//k70.p08 = (unsigned) param;
*((unsigned*)&k70 + 2) = (unsigned) param;
k70.p12 = 0;
k70.p16 = 0;
k70.p20 = 0;
@@ -9,7 +9,7 @@ char buf[4];
k70.p00 = 0;
k70.p04 = 0;
k70.p08 = 0;
//k70.p08 = 0;
k70.p12 = 4; // ÷èòàòü 4 áàéòà
k70.p16 = (unsigned) buf;
k70.p20 = 0;
@@ -30,11 +30,13 @@ int script_run(char exec[], char args[])
kol_struct70 k70;
kol_struct_BDVK bdvk;
unsigned result, filesize, pos, i;
unsigned result, i;
unsigned long long filesize, pos;
char *buf; //áóôåð, êóäà êîïèðóåòñÿ ñêðèïò
k70.p00 = 5;
k70.p04 = k70.p08 = k70.p12 = 0;
k70.p04 = k70.p12 = 0;
//k70.p08 = 0;
k70.p16 = (unsigned) &bdvk;
k70.p20 = 0;
k70.p21 = exec;
@@ -43,16 +45,17 @@ result = kol_file_70(&k70); //
if ( 0 != result )
return FALSE;
filesize = bdvk.p32[0]; // ïîëó÷àåì ðàçìåð ôàéëà
filesize = bdvk.p32; // ïîëó÷àåì ðàçìåð ôàéëà
buf = malloc(filesize+256);
buf = malloc(filesize+256); // may fail for over 4Gb file, but impossible case
if (NULL == buf)
return FALSE;
buf[filesize]=0;
k70.p00 = 0;
k70.p04 = k70.p08 = 0;
k70.p04 = 0;
//k70.p08 = 0;
k70.p12 = filesize;
k70.p16 = (unsigned) buf;
k70.p20 = 0;