Subversion Repositories Kolibri OS

Rev

Rev 6251 | Blame | Last modification | View Log | Download | RSS feed

  1. BDVK file_info_count;
  2. int file_count_copy;
  3.  
  4. void DirFileCount(dword way)
  5. {
  6.         dword dirbuf, fcount, i, filename;
  7.         dword cur_file;
  8.         if (dir_exists(way))
  9.         {
  10.                 cur_file = malloc(4096);
  11.                 // In the process of recursive descent, memory must be allocated
  12.                 // dynamically, because the static variable cause a fault!!!
  13.                 // But unfortunately pass away to sacrifice speed.
  14.                 GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL);
  15.                 filename = dirbuf+72;
  16.                 for (i=0; i<fcount; i++)
  17.                 {
  18.                         filename += 304;
  19.                         sprintf(cur_file,"%s/%s",way,filename);
  20.                        
  21.                         if (TestBit(ESDWORD[filename-40], 4) )
  22.                         {
  23.                                 file_count_copy++;
  24.                                 DirFileCount(cur_file);
  25.                         }
  26.                         else
  27.                         {
  28.                                 file_count_copy++;
  29.                         }
  30.                 }
  31.                 free(cur_file);
  32.         }
  33. }
  34.  
  35.