Arduino Mega with W5100 SDfat.h error

Please Help

I am using arduino 10.0.5-r2 with a Mega 2560 with W5100 shield

i am trying to create a dynamic file with this code:

char chartemp[13];
sprintf(chartemp, "%04d%02d%02d.CSV", year(), month(), day());
if (arquivos.open(root, chartemp, O_CREAT | O_TRUNC | O_WRITE)) {

he give me a error and cannot create or append file

if i use:

if (arquivos.open(root, "20140522.CSV", O_CREAT | O_TRUNC | O_WRITE)) { it work

already try with toCharArray, strcpy_P, only work with the string direct in open command.

any clue?

Try printing chartemp to the serial monitor and see where the problem is.

when i println the chartemp it return 20140522.CSV

Please post your entire sketch and I'll take a look.

Found it

between the file name setup and open the file, i forgot and i used the chartemp variable.

Sorry