Filename corruption creating files with LocalFileSystem

22 May 2009 . Edited: 22 May 2009

I'm attempting to create a file with two dots in the filename, and the resulting filename is corrupted.

This isn't a serious problem, but should perhaps be documented. Is it using 8.3 file naming (MS DOS) ?
John F.

program output: 
File create/write test 
Opening /local/file1 for writing 
Closing /local/file1 
Opening /local/file2.txt for writing 
Closing /local/file2.txt 
Opening /local/file.3.txt for writing 
Closing /local/file.3.txt 
files created: 
  -rw-rw-rw-   1 John     root       17 Jan  1  2008 FILE.3XT 
  -rw-rw-rw-   1 John     root       17 Jan  1  2008 FILE1 
  -rw-rw-rw-   1 John     root       17 Jan  1  2008 FILE2.TXT 

All filenames are converted to upper case, only the first 3 alphanum chars after the first dot are used as
extension.

22 May 2009 . Edited: 22 May 2009

Hi John,

This happens because we convert the filename specified by the user to a valid FAT 8.3 filename which only permits certain characters. Lower case characters are converted to upper case, spaces are converted to underscores and invalid characters are converted to 'X'. file.3.txt -> FILE.3XT

The second '.' is invalid and is converted to 'X'. 'X' may not be the best choice, unfortunately we can’t use '?' as it's also not a valid character.

Thanks for pointing this out...
Cheers,
Chris

08 Mar 2010

Chris Styles wrote:
Hi John, This happens because we convert the filename specified by the user to a valid FAT 8.3 filename which only permits certain characters. Lower case characters are converted to upper case, spaces are converted to underscores and invalid characters are converted to 'X'. file.3.txt -> FILE.3XT The second '.' is invalid and is converted to 'X'. 'X' may not be the best choice, unfortunately we can’t use '?' as it's also not a valid character. Thanks for pointing this out... Cheers, Chris
And is there a limitation of the number of file ? I may need a lot of very small files, it would be easier than using and editing a big one

thank you for the input

and is there a list of the fonctions already in the mbed.h library ? (math, string manipulation, bytes manipulation ....) I can't find documentation and I suppose all the C function are not avaible

thank you again