This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FLASH FS filename mangling

Hi all,

Can anyone tell me what filename mangling for 8.3 DOS-style filenames has been introduced in recent versions of the FLASHFS?

One of my filenames is being inexplicably renamed from snapshot.dat to SNAPSHOT.DAT, perhaps as a consequence of opening it for append - but I need to investigate a little more.

I am using a parallel FLASH device, not an SPI memory card. I am using the FLASH FS from RTL V3.22.

The FLASH FS from RTL V3.05 did not do this filename alteration.

Many thanks for any info.

Christopher Hicks

Parents
  • I think I have found the bug.

    ffind is documented as having the signature:

    int ffind (
      const char *pattern,    /* pattern to match files to */
      FINFO *info);           /* file info structure */
    

    In the source code fs_ffind.c we find that pattern is copied to a const char *pat (OK, line 49) but then on line 80 the "const" qualifier on the pat is cast away and then pattern is modified in place.

       /* Convert pattern to uppercase. */
       chr_ptr = (char *) pat;
       while (*chr_ptr) {
          if (*chr_ptr >= 'a' && *chr_ptr <= 'z')
             *chr_ptr &= ~0x20;
          chr_ptr++;
       }
    

    Will report this directly to Keil.

    CH
    ==

Reply
  • I think I have found the bug.

    ffind is documented as having the signature:

    int ffind (
      const char *pattern,    /* pattern to match files to */
      FINFO *info);           /* file info structure */
    

    In the source code fs_ffind.c we find that pattern is copied to a const char *pat (OK, line 49) but then on line 80 the "const" qualifier on the pat is cast away and then pattern is modified in place.

       /* Convert pattern to uppercase. */
       chr_ptr = (char *) pat;
       while (*chr_ptr) {
          if (*chr_ptr >= 'a' && *chr_ptr <= 'z')
             *chr_ptr &= ~0x20;
          chr_ptr++;
       }
    

    Will report this directly to Keil.

    CH
    ==

Children