Long File names on the SDCARD

Discussion to talk about software related topics only.
Post Reply
hendrixj
Posts: 33
Joined: Thu Oct 23, 2008 11:39 am

Long File names on the SDCARD

Post by hendrixj »

Does netburner provide docs/examples on reading and writing using long file names on the SDCARD?
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Re: Long File names on the SDCARD

Post by Ridgeglider »

Long file names ARE supported and work well!
See the EFFS Programmers Manual, Pg 17:
(quoted at the end of this message...)

The manual description is a bit dated. I modify constants.h as follows:

Code: Select all

#ifdef NB_SSH_SUPPORTED
   #define IP_STK_SIZE           (4096)
   #define TCP_STK_SIZE          (4096)
   #define HTTP_STK_SIZE         (2048)
   #define IDLE_STK_SIZE         (2048)
   #define ETHER_SEND_STK_SIZE   (2048)
   #define USER_TASK_STK_SIZE    (4096 * 4)
#else /* #ifdef NB_SSH_SUPPORTED */
   #define IP_STK_SIZE           (2048)
   #define TCP_STK_SIZE          (2048)
   #define HTTP_STK_SIZE         (2048)
   #define IDLE_STK_SIZE         (2048)
   #define ETHER_SEND_STK_SIZE   (2048)
   #define USER_TASK_STK_SIZE    (2048 * 4)

Here's the manual's description:
5.5 Long File Names
The EFFS supports the 8.3 format by default, and optionally supports long file names. The long filename is optional because of the increase in system resources required to do long filenames. In particular the stack sizes of applications which call the file system must be increased and the amount of checking required is increased. The maximum long filename space required by the standard is 260 bytes. As a consequence each time a long filename is processed large areas of memory must be available.
To switch from the 8.3 format to long file names:
1. Edit \nburn\include\constants.h and increase the user task stack size to a minimum of 8096. #define USER_TASK_STK_SIZE (8096)
2. Run the batch file: “\nburn\pcbin\longfilenames.bat”. This will switch the EFFS library to the long file name version.
3. Rebuild the system library. From NBEclipse, select “NBEclipse -> Rebuild System Files”. For command line users, go to c:\nburn\system, and run “make clean” followed by “make”.
4. Rebuild your application.

On December 3rd 2003 Microsoft announced that it would exercise its patent rights relating to certain elements of how long filenames are implemented in FAT file systems. As a consequence it is up to the user to contact Microsoft to get the required licenses should they use the long filename option. It is also possible that some flash card manufacturers may obtain rights to use long file names on their media. You will need to check with your flash card vendor to determine if this is the case.
Post Reply