Subversion Repositories Kolibri OS

Rev

Go to most recent revision | 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 (isdir(way))
  9.         {
  10.                 cur_file = malloc(4096);
  11.                 // In the process of recursive descent, memory must be allocated dynamically, because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed.
  12.                 GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL);
  13.                 for (i=0; i<fcount; i++)
  14.                 {
  15.                         filename = i*304+dirbuf+72;
  16.                         sprintf(cur_file,"%s/%s",way,filename);
  17.                        
  18.                         if (TestBit(ESDWORD[filename-40], 4) )
  19.                         {
  20.                                 file_count_copy++;
  21.                                 DirFileCount(cur_file);
  22.                         }
  23.                         else
  24.                         {
  25.                                 file_count_copy++;
  26.                         }
  27.                 }
  28.                 free(cur_file);
  29.         }
  30. }
  31.  
  32.