Apache DLL file - unexpected error - confused newbie Correction

G

Greg M

Correction...

/*CUT*/

long dirs_size(const char *curdir)
{
struct _finddata_t c_file;
long hFile;
long totalsize=0;
char *curdirr;
char *filedir;
curdirr= (char*) curdir;
strcpy(curdirr, "\\*.*");

if( (hFile = _findfirst( curdirr, &c_file )) == -1L )
{}
else
{

if (c_file.attrib & _A_SUBDIR){

if ((strcmp(c_file.name,"."))==0) {
} else {
if ((strcmp(c_file.name,".."))==0) {
} else {
filedir = (char*) curdir;
strcpy(filedir,"\\");
strcpy(filedir,c_file.name);
totalsize += dirs_size(filedir);
//printf("Dir %d\n",totalsize);
}
}
}else{
totalsize += c_file.size;
//printf("Files %d\n",c_file.size);
};

while( _findnext( hFile, &c_file ) == 0 )
{

if (c_file.attrib & _A_SUBDIR){


if ((strcmp( c_file.name, "."))==0) {
} else {
if ((strcmp(c_file.name,".."))==0) {
} else {

if ((strcmp(c_file.name,".DAV"))==0) {
//printf("DAV");
} else {
filedir = (char*) curdir;
strcpy(filedir,"\\");
strcpy(filedir,c_file.name);
totalsize += dirs_size((const char*) filedir);
/* The code fails when the dirs_size statement is called from within itself
*/
}
//printf("Dir %d\n",totalsize);
}
}
}else{
totalsize += c_file.size;
//printf("Files %d\n",c_file.size);
};

}
_findclose( hFile );
}
return totalsize;
}

/*EOF*/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top