Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | 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.         printf("  rmdir directory\n\r");
  12.         return FALSE;
  13.         }
  14.  
  15. if ( ( 0 == strcmp(dir, ".") ) || ( 0 == strcmp(dir, "..") ) || ( 0 == strcmp(cur_dir, "/")) )
  16.         {
  17.         return FALSE;
  18.         }
  19.  
  20. k70.p00 = 8;
  21. k70.p04 = 0;
  22. k70.p08 = 0;
  23. k70.p12 = 0;
  24. k70.p16 = 0;
  25. k70.p20 = 0;
  26.  
  27. if ( '/' == dir[0])
  28.         k70.p21 = dir;
  29. else
  30.         {
  31.         strcpy(temp, cur_dir);
  32.         strcat(temp, dir);
  33.         k70.p21 = temp;
  34.         }
  35.  
  36. if ( !dir_check(temp) )
  37.         return FALSE;
  38.  
  39. result = kol_file_70(&k70);
  40.  
  41. if (0 == result)
  42.         return TRUE;
  43. else
  44.         return FALSE;
  45.  
  46. }
  47.