G
Greg M
Hello, I am using Visual C++ Studio 6.0 to compile a module i have written
for apache under windows xp.
The code compiles perfectly, however when used by the dll, the code fails.
This causes my webdav client to fail..
Please could you help me by telling me what im doing wrong.
Greg Miell
FILE: fullrw.c
/*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);
return 0;
}
//printf("Dir %d\n",totalsize);
}
}
}else{
totalsize += c_file.size;
//printf("Files %d\n",c_file.size);
};
}
_findclose( hFile );
}
return totalsize;
}
/*EOF*/
for apache under windows xp.
The code compiles perfectly, however when used by the dll, the code fails.
This causes my webdav client to fail..
Please could you help me by telling me what im doing wrong.
Greg Miell
FILE: fullrw.c
/*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);
return 0;
}
//printf("Dir %d\n",totalsize);
}
}
}else{
totalsize += c_file.size;
//printf("Files %d\n",c_file.size);
};
}
_findclose( hFile );
}
return totalsize;
}
/*EOF*/