Subversion Repositories Kolibri OS

Rev

Rev 2077 | Rev 2615 | 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. //      strcat(exec, "/"); // add slash
  30.         strcat(exec, cmd);
  31.        
  32.         if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
  33.                 {
  34.                 strcpy(exec, "/rd/1/"); // ¯à®¢¥à塞 ä ©« ­  ¢¨àâã «ì­®¬ ¤¨áª¥
  35.                 strcat(exec, cmd);
  36.                         if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
  37.                                 {
  38.                                 printf(error_starting, cmd);
  39.                                 return FALSE;
  40.                                 }
  41.                 }
  42.         }
  43.  
  44.  
  45. if ( script_check(exec) )
  46.         return script_run(exec, args);
  47.  
  48. /* § ¯ã᪠¯à®£à ¬¬ë */
  49. result = program_run(exec, args);
  50. if (result > 0)
  51.         {
  52.        
  53.         if ( !program_console(result)  )
  54.                 {
  55.                 #if LANG_ENG
  56.                         printf ("  '%s' started. PID = %d\n\r", cmd, result);
  57.                 #elif LANG_RUS
  58.                         printf ("  '%s' § ¯ã饭. PID = %d\n\r", cmd, result);
  59.                 #endif
  60.                 }
  61.         return TRUE;
  62.         }
  63. else   
  64.         {
  65.         printf(error_starting, cmd);
  66.         return FALSE;
  67.         }
  68.  
  69. }
  70.  
  71. /// ===========================================================
  72.