2013-06-03 03:34 PM
Hi!
I'm using popular fatfs library to handle my SD card. Now I have to use longer file name, so Ive decided to use LFN. With standard file name this code works fine:char lolek[]=''data1234.kml'';
fresult = f_mount( 0, &fatfs ); //mount sd fresult = f_open( &plik, (const char*)lolek , FA_OPEN_ALWAYS | FA_WRITE ); But LFN works only like this:TCHAR* lolek = _T(''asdfasfdas'');
fresult = f_mount( 0, &fatfs ); //mount sd
fresult = f_open( &plik, lolek , FA_OPEN_ALWAYS | FA_WRITE ); How to convert standard char* table to TCHAR* table ? Its a real big riddle for me. Regards.2013-06-03 05:28 PM
How about one character at a time using some rudimentary C
TCHAR tarr[512], *t = tarr;
char test[] = ''long_filename_test'';
char *s = test;
while(*s)
*t++ = (TCHAR)*s++;
*t = 0;
fresult = f_mount( 0, &fatfs);
fresult = f_open( &plik, tarr, FA_OPEN_ALWAYS | FA_WRITE );