Subversion Repositories Kolibri OS

Rev

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