Does this happen with any SD card or just with a particular one? Does this happen if you reformat the SD card and then run your particular test?
The FAT16 spec handles the root directory some what differently than the subdirectories on the card. In particular, the space allocated for directory entries are fixed in size for the root directory but are allocated as needed for subdirectories. For long filenames (greater than 8.3), two or more contiguous directory entries are needed to store the file name (depending upon the length). Its possible that over time the SD card does not have the needed contiguous directory entries to store the file name (especially if you are using really long names). Using the subdirectories on the card is almost always a better solution than using the root directory. Mark -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marshall Mathers Sent: Friday, April 08, 2005 9:03 AM To: Palm Developer Forum Subject: RE: Problems with long file names in OS 5.4 Complete details of the problem, should someone care to investigate. We have a Treo 650, Palm OS 5.4.0, Phone Software: Treo6XX-/78/B01.00-I, Phone Hardware: C2, with an SD card labelled "FSD256SIM, M423F4JM0002", CardInfo shows 140.9MB, "TWTTI". The volInfo.fsType equals 'vfat'. There are 3 files and 5 directories on the card before it is written to, and 6 files afterwards. This code: char *sz_filenames[4] = { "abcdef", "abcdefg", "abcdefgh", "abcdefghi" }; for ( int i=0; i<4; i++ ) { char sz_mess[256] = ""; UInt16 fileerr = VFSFileCreate( volRefNum, sz_filenames[i] ); StrPrintF( sz_mess, "name=%s, err=%d\n", sz_filenames[i], fileerr ); FldInsert( field, sz_mess, StrLen(sz_mess) ); } The first time it is run, shows: name=abcdef,err=0 name=abcdefg,err=0 name=abcdefgh,err=0 name=abcdefghi,err=10754 Files "abcdef", "abcdefg", "abcdefgh" are created in the root directory of the card. File "abcdefghi" is not. The second time it is run (when three files have been created once), shows: name=abcdef,err=10758 name=abcdefg,err=10758 name=abcdefgh,err=10758 name=abcdefghi,err=10754 There is no problem if we write to a sub-directory. Thank you for your attention, M -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
