Skip to content

Long File Name Note

Demitrios V edited this page Mar 16, 2020 · 3 revisions

About Long File Names

Marlin firmware's file system code does NOT provide much support for Microsoft's long file name (LFN) additions to the DOS file system. Basically, Marlin firmware can only read a long file name that is associated with the "8.3 DOS" file name. This capability along with the firmware's support for the "8.3 DOS" file name format is adequate for our 3d printer with one memory card. However, we've added a few enhancements to make the printer a bit more user friendly.

  • The M20 command, list sd contents, includes the optional parameter M20 P0 (list 8.3 file names) or M20 P1 (list long file names). As of firmware 119r08, the default is to list long file names when no optional parameter is provided. This change, along with the change to the M23 command, lets Octoprint display and open files using long file names with no special setup or configuration.

  • The M32 command (open file and print) and the M23 command (open file) accept either a long file name or an 8.3 file name. The command first tries to find the file by matching the long file name. If this is not successful, the command will again try to find the file by matching the short (8.3) file name. The search always begins at the root directory, so the path given as an argument to the M32 command should always begin with a "/". Special characters can be quoted (escaped) by preceding the special character with a backslash "\", though Marlin's design may make quoting a bit quirky. Due to a bug in Marlin, the "#" character cannot be quoted correctly at all (perhaps this will eventually be fixed).

CAVEAT

Unfortunately, the Marlin commands to delete or create files on the micro SD card do NOT support long file names. It is important to avoid using these commands to delete a file (by using its short 8.3 file name ) that has a long file name attached to it. While the file itself will be deleted, the directory entries containing the long file name will not be deleted, leaving "garbage" directory entries on the memory card.