client/src/unifycr.c
int unifycr_fid_is_dir_empty(const char * path)
{
    int i = 0;
    while (i < unifycr_max_files) {
       if(unifycr_filelist[i].in_use) {
           /* if the file starts with the path, it is inside of that directory 
            * also check to make sure that it's not the directory entry itself */
           char * strptr = strstr(path, unifycr_filelist[i].filename);
           if (strptr == unifycr_filelist[i].filename && strcmp(path,unifycr_filelist[i].filename)) {
              debug("File found: unifycr_filelist[%d].filename = %s\n",
                    i, (char*)&unifycr_filelist[i].filename
              );
              return 0;
           }
       } 
       ++i;
    }

    /* couldn't find any files with this prefix, dir must be empty */
    return 1;
}
/* checks to see if a directory is empty
 * assumes that check for is_dir has already been made
 * only checks for full path matches, does not check relative paths,
 * e.g. ../dirname will not work
 * returns 1 for yes it is empty
 * returns 0 for no */
checks to see if a directory is empty
assumes that check for is_dir has already been made
only checks for full path matches, does not check relative paths,
e.g. ../dirname will not work
returns 1 for yes it is empty
returns 0 for no
checks to see if a directory is empty assumes that check for is_dir has already been made only checks for full path matches does not check relative paths e . g . .. / dirname will not work returns 1 for yes it is empty returns 0 for no
int unifycr_fid_is_dir_empty(const char * path)
{
    int i = 0;
    while (i < unifycr_max_files) {
       if(unifycr_filelist[i].in_use) {
           char * strptr = strstr(path, unifycr_filelist[i].filename);
           if (strptr == unifycr_filelist[i].filename && strcmp(path,unifycr_filelist[i].filename)) {
              debug("File found: unifycr_filelist[%d].filename = %s\n",
                    i, (char*)&unifycr_filelist[i].filename
              );
              return 0;
           }
       } 
       ++i;
    }
    return 1;
}
int unifycr_fid_is_dir_empty ( const char * path ) { int i = 0 ; while ( i < unifycr_max_files ) { if ( unifycr_filelist [ i ] . in_use ) { char * strptr = strstr ( path , unifycr_filelist [ i ] . filename ) ; if ( strptr == unifycr_filelist [ i ] . filename && strcmp ( path , unifycr_filelist [ i ] . filename ) ) { debug ( " \n " , i , ( char * ) & unifycr_filelist [ i ] . filename ) ; return 0 ; } } ++ i ; } return 1 ; }
checks to see if a directory is empty
 assumes that check for is_dir has already been made
 only checks for full path matches, does not check relative paths,
 e.g.
checks to see if a directory is empty assumes that check for is_dir has already been made only checks for full path matches does not check relative paths e . g .
/* if the file starts with the path, it is inside of that directory 
            * also check to make sure that it's not the directory entry itself */ /* couldn't find any files with this prefix, dir must be empty */