2015-09-05 20:50:37 +03:00
BDVK file_info_count ;
int file_count_copy ;
void DirFileCount ( dword way )
{
dword dirbuf , fcount , i , filename ;
dword cur_file ;
2016-02-19 03:33:21 +03:00
if ( dir_exists ( way ) )
2015-09-05 20:50:37 +03:00
{
cur_file = malloc ( 4096 ) ;
// 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.
GetDir ( # dirbuf , # fcount , way , DIRS_ONLYREAL ) ;
2015-12-14 17:50:28 +03:00
filename = dirbuf + 72 ;
2015-09-05 20:50:37 +03:00
for ( i = 0 ; i < fcount ; i + + )
{
2015-12-14 17:50:28 +03:00
filename + = 304 ;
2015-09-05 20:50:37 +03:00
sprintf ( cur_file , " %s/%s " , way , filename ) ;
if ( TestBit ( ESDWORD [ filename - 40 ] , 4 ) )
{
file_count_copy + + ;
DirFileCount ( cur_file ) ;
}
else
{
file_count_copy + + ;
}
}
free ( cur_file ) ;
}
}