src/function.c
bool checkValid(char *str)
{
    int count=0;                                            // counting the number of dots in the filename
    int i=0;
    
    /**
     * traversing the string and counting . chars
     **/
    while(str[i]!='\0')
    {
        if(wildcard(str[i]))
        {
            return false;
        }
        if(str[i]=='.')
        {
            count++;
        }
        i++;
    }
    if(count==1)                                            // valid for only one dot in string
    {
        return true;
    }
    return false;
}
/**
 * it will check whether the string is valid or not
 * i.e it contains single . or not
 * 
 * @param string
 * 
 * @return bool
 **/
it will check whether the string is valid or not
i.e it contains single . or not

@param string

@return bool
it will check whether the string is valid or not i . e it contains single . or not @param string @return bool
bool checkValid(char *str)
{
    int count=0;                                            
    int i=0;
    while(str[i]!='\0')
    {
        if(wildcard(str[i]))
        {
            return false;
        }
        if(str[i]=='.')
        {
            count++;
        }
        i++;
    }
    if(count==1)                                            
    {
        return true;
    }
    return false;
}
bool checkValid ( char * str ) { int count = 0 ; int i = 0 ; while ( str [ i ] != ' \0 ' ) { if ( wildcard ( str [ i ] ) ) { return false ; } if ( str [ i ] == ' ' ) { count ++ ; } i ++ ; } if ( count == 1 ) { return true ; } return false ; }
it will check whether the string is valid or not
 i.e it contains single .
it will check whether the string is valid or not i . e it contains single .
// counting the number of dots in the filename /**
     * traversing the string and counting . chars
     **/ // valid for only one dot in string