How I do?

Is it possible? I want to create files from the external hardware of my project with a GLCD screen keyboard, but I think I will have problems with this function:

datafile = SD.open ("File.txt", file_write);

i would like to change "File.txt" for some variable that stores the file name that I give it.

How can I ever naming and create my new files from the outside?

thank you so much

i would like to change "File.txt" for some variable that stores the file name that I give it.

Go ahead no one is stopping you.

How can I ever naming and create my new files from the outside?

If you want a name then that has to be communicated somehow from the outside, normally by a serial input.

You can number files by adding a postfix number and increment that with each file you create. You can store the number in EEPROM if you want so that even when the power is removed you can remember the last file number.

Thank you very much Grumpy_Mike, actually what I need is to create new files. Txt with the name I want without having to do it through the skit arduino if not from the hardware of my project which I got it, the problem is that the function mycard = SD.open ("File.txt" file_write); It has not let me place a variable that you can assign the name of each of my files to create, as the part where the name and the file type "File.txt" is assigned is of type (const char *) and so far I have to assign a time in the programming of the sketch and that forces me to have to carry my laptop and edit the sketch in arduino when I have to create each file.

Younare wrong, you can replace that part of the open with a variable.

So us the part of the code where you define the file name variable and try and apply it to open the file.