Subversion Repositories Kolibri OS

Rev

Rev 2502 | Rev 2617 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. /// ===========================================================
  3.  
  4. int executable_run(char cmd[], char args[])
  5. {
  6.  
  7. char            exec[256];
  8. #if LANG_ENG
  9.         char            error_starting[]={"  No such command '%s'.\n\r"};
  10. #elif LANG_RUS
  11.         char            error_starting[]={"  ¥â â ª®© ª®¬ ­¤ë - '%s'.\n\r"};
  12. #endif
  13. int             result;
  14.  
  15. if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì  ¡á®«îâ­ë©
  16.         {
  17.         strcpy(exec, cmd);
  18.  
  19.         if (  !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
  20.                 {
  21.                 printf(error_starting, cmd);
  22.                 return FALSE;
  23.                 }
  24.         }
  25.  
  26. else
  27.         {
  28.         strcpy(exec, cur_dir); // ¯à®¢¥à塞 ä ©« ¢ ⥪ã饬 ª â «®£¥
  29.         if (exec[strlen(exec)-1] != '/')
  30.                 strcat(exec, "/"); // add slash
  31.         strcat(exec, cmd);
  32.        
  33.         printf("\n%s\n", exec);
  34.        
  35.         if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
  36.                 {
  37.                 strcpy(exec, "/rd/1/"); // ¯à®¢¥à塞 ä ©« ­  ¢¨àâã «ì­®¬ ¤¨áª¥
  38.                 strcat(exec, cmd);
  39.                         if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
  40.                                 {
  41.                                 printf(error_starting, cmd);
  42.                                 return FALSE;
  43.                                 }
  44.                 }
  45.         }
  46.  
  47.  
  48. if ( script_check(exec) )
  49.         return script_run(exec, args);
  50.  
  51. /* § ¯ã᪠¯à®£à ¬¬ë */
  52. result = program_run(exec, args);
  53. if (result > 0)
  54.         {
  55.        
  56.         if ( !program_console(result)  )
  57.                 {
  58.                 #if LANG_ENG
  59.                         printf ("  '%s' started. PID = %d\n\r", cmd, result);
  60.                 #elif LANG_RUS
  61.                         printf ("  '%s' § ¯ã饭. PID = %d\n\r", cmd, result);
  62.                 #endif
  63.                 }
  64.         return TRUE;
  65.         }
  66. else   
  67.         {
  68.         printf(error_starting, cmd);
  69.         return FALSE;
  70.         }
  71.  
  72. }
  73.  
  74. /// ===========================================================
  75.