Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. int cmd_rm(char file[]) {
  3.  
  4.         kol_struct70    k70;
  5.         char            temp[FILENAME_MAX];
  6.         unsigned        result;
  7.  
  8.         if (NULL == file || strlen(file) == 0) {
  9.                 printf (CMD_RM_USAGE);
  10.                 return TRUE;
  11.         }
  12.  
  13.         if ( '/' == file[0])
  14.                 {
  15.                 strcpy(temp, file);
  16.  
  17.                 if ( !file_check(temp) )
  18.                         {
  19.                         return FALSE;
  20.                         }
  21.                 }
  22.         else
  23.                 {
  24.                 strcpy(temp, cur_dir);
  25.                 if (temp[strlen(temp)-1] != '/')
  26.                         strcat(temp, "/"); // add slash
  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.  
  52.