Pages: [1]   Go Down
Author Topic: How many bytes can name a file using SD.open?  (Read 1350 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I am trying to rename a .txt file dynamically (an ID and the current date) but I realized that the file does not name over 8 characters.
That is, I can only use 8 bytes for a file name?
thanks
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Correct, you can only use 8 characters(8 Bytes) and a 3 character extension.

Code:
eg. textfile.txt
     (8).(3)
I used folders to sort out the problem your describing:
Code:
2012/11/08/<ID>.txt


Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How to create directories on the sd card with arduino?
thanks...
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
if(!sd.exists(string)){
   sd.mkdir(string);
}
Feel free to make multiple levels of folders at once:
sd.mkdir("2012/11/09/");

works smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Even Linux terminal command
Thanks ahref  smiley-lol
Logged

Pages: [1]   Go Up
Jump to: