Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. int cmd_rm(char file[])
  3. {
  4.  
  5. kol_struct70    k70;
  6. char            temp[256];
  7. unsigned        result;
  8.  
  9. if (NULL == file)
  10.         {
  11.         printf ("  rm filename\n\r");
  12.         return FALSE;
  13.         }
  14.  
  15. if ( '/' == file[0])
  16.         {
  17.         strcpy(temp, file);
  18.  
  19.         if ( !file_check(temp) )
  20.                 {
  21.                 return FALSE;
  22.                 }
  23.         }
  24. else
  25.         {
  26.         strcpy(temp, cur_dir);
  27.         strcat(temp, file);
  28.        
  29.         if ( !file_check(temp) )
  30.                 {
  31.                 return FALSE;
  32.                 }
  33.         }
  34.  
  35. k70.p00 = 8;
  36. k70.p04 = 0;
  37. k70.p08 = 0;
  38. k70.p12 = 0;
  39. k70.p16 = 0;
  40. k70.p20 = 0;
  41. k70.p21 = temp;
  42.  
  43. result = kol_file_70(&k70);
  44.  
  45. if (0 == result)
  46.         return TRUE;
  47. else
  48.         return FALSE;
  49.  
  50. }
  51.