SD Filenames

I keep getting errors when I use SD.mkdir. This is my code:

if(char(serialReceived) == '\n') {
        Serial.print("MKDIR: ");
        Serial.println(serialCommand);
        Serial.println(serialCommand.length());
        char sen[serialCommand.length()+1];
        for(int i = 0; i < serialCommand.length(); i++) {
          sen[i] = serialCommand.charAt(i);
        }
        if(SD.mkdir(sen)) {
          Serial.write(6);
        } else {
          Serial.write(21);
        }
        serialState = 0;
        serialCommand = "";
      } else {
        serialCommand += char(serialReceived);
      }

When I run this code, I get that SD.mkdir(sen) returns false.

You need to store a null at the end of the string. Try this:

        int i;
        for(i = 0; i < serialCommand.length(); i++) {
          sen[i] = serialCommand.charAt(i);
        }
        sen[i] = 0;

You should also make sure that the names you use are valid.
Pete