Rev 2617 |
Rev 6825 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| Download
| RSS feed
/// ===========================================================
int executable_run(char cmd[], char args[])
{
char exec[256];
int result;
if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì ¡á®«îâë©
{
if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ¨¥ ä ©«
{
file_not_found(cmd);
return FALSE;
}
}
else
{
strcpy(exec
, cur_dir
); // ¯à®¢¥à塞 ä ©« ¢ ⥪ã饬 ª â «®£¥
if (exec
[strlen(exec
)-1] != '/')
strcat(exec
, "/"); // add slash
if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ¨¥ ä ©«
{
strcpy(exec
, "/rd/1/"); // ¯à®¢¥à塞 ä ©« ¢¨àâ㠫쮬 ¤¨áª¥
if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ¨¥ ä ©«
{
file_not_found(cmd);
return FALSE;
}
}
}
if ( script_check(exec) )
return script_run(exec, args);
/* § ¯ã᪠¯à®£à ¬¬ë */
result = program_run(exec, args);
if (result > 0)
{
if ( !program_console(result) )
{
#if LANG_ENG
printf (" '%s' started. PID = %d\n\r", cmd
, result
);
#elif LANG_RUS
printf (" '%s' § ¯ãé¥. PID = %d\n\r", cmd
, result
);
#endif
}
return TRUE;
}
else
{
file_not_found(cmd);
return FALSE;
}
}
/// ===========================================================