Using strncmp with a variable string and characters

I am trying to compare a a received string in arduino to strings in a textfile to find a match, the text file contents are read perfectly just that the function will not accept the variable string.

char buf[11];
String inputString = ""; 

  myFile.read(buf,11);        
        if(strncmp(buf,inputString,9)==0)
        {
            Serial.println("Match!");       
        }

it says cannot convert 'String' to constant char for argument and will not compile.
Please tell me some way i could compare the data in both variables.

You could drop the use of String and use str(n)cmp.

To coattail AWOL's comment, the String class is not the same as a char array. Not a good idea to mix the two.

how could i convert the string to a compatible type?
i use the string because the data is received in single characters anyway i could change this method to make str(n)cmp work?

  while (keyboard.available()){
      // read the next key
      char p = keyboard.read();

      if (p == 'j') {
        stringComplete = true;
      } 
      else  { 
        inputString += p;
      }

I'm not sure what you're trying to do, but give your code, you could code it as:

char p;
int index = 0;

while (keyboard.available()){
   // read the next key
   p = keyboard.read();

   if (p == 'j') {
     stringComplete = true;
     break;                                     // Message completed
   } else  { 
     buf[index++} = p;
   }
}
buf[index] = '\0';   // Add if you want to treat it as a string.

Thank you econjack. I decided to just convert the string to a char array.
Thank you for your help also AWOL.