Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. int cmd_rmdir(char dir[])
  3. {
  4.  
  5. char            temp[256];
  6. kol_struct70    k70;
  7. unsigned        result;
  8.  
  9. if (NULL == dir)
  10.         {
  11.         #if LANG_ENG
  12.                 printf("  rmdir <directory>\n\r");
  13.         #elif LANG_ENG
  14.                 printf("  rmdir <¤¨à¥ªâ®à¨ï>\n\r");
  15.         #endif
  16.         return FALSE;
  17.         }
  18.  
  19. if ( ( 0 == strcmp(dir, ".") ) || ( 0 == strcmp(dir, "..") ) || ( 0 == strcmp(cur_dir, "/")) )
  20.         {
  21.         return FALSE;
  22.         }
  23.  
  24. k70.p00 = 8;
  25. k70.p04 = 0;
  26. k70.p08 = 0;
  27. k70.p12 = 0;
  28. k70.p16 = 0;
  29. k70.p20 = 0;
  30.  
  31. if ( '/' == dir[0])
  32.         k70.p21 = dir;
  33. else
  34.         {
  35.         strcpy(temp, cur_dir);
  36.         strcat(temp, dir);
  37.         k70.p21 = temp;
  38.         }
  39.  
  40. if ( !dir_check(temp) )
  41.         return FALSE;
  42.  
  43. result = kol_file_70(&k70);
  44.  
  45. if (0 == result)
  46.         return TRUE;
  47. else
  48.         return FALSE;
  49.  
  50. }
  51.