Apache DLL file - unexpected error - confused newbie Correction

Discussion in 'C++' started by Greg M, May 24, 2004.

  1. Greg M

    Greg M Guest

    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*/
     
    Greg M, May 24, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    8,996
  2. Greg M
    Replies:
    3
    Views:
    512
    Kelsey Bjarnason
    Jun 7, 2004
  3. Joseph
    Replies:
    1
    Views:
    108
  4. H. Simpson
    Replies:
    4
    Views:
    342
    H. Simpson
    Aug 3, 2004
  5. Selmar
    Replies:
    2
    Views:
    199
    krakle
    Jul 21, 2004
Loading...

Share This Page