Shop OBEX P1 Docs P2 Docs Learn Events
8.3 File System Names — Parallax Forums

8.3 File System Names

KyeKye Posts: 2,200
edited 2009-12-16 00:06 in Propeller 1
Hey guys,

Since the school semester is over I'll be going back to work on the full featured FAT32/16 file system I was making.

Anyway, there are a few things I would like to ask of the forums about·perfered functionality.

The first is, what is perfered, raw 8.3 file system names or slightly formated file system names when "listName" is returning (the basic listing function).

The differences would be:

(RAW)

FOOBAR··C
FOO······ MP3
..etc

(Slightly Formated)

FOOBAR.C
FOO.MP3

The advantages of using RAW names is that it requires alot less code, about 50 - 70 longs, and that the formating always comes out at 11 characters.

Slightly formated names use alot more space because I have to play arround with the names alot to communicate between various functions and keep everything right with the FAT. This also will implicitly slow down the code ever so slightly.

Any thoughts?

Thanks,
··

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Post Edited (Kye) : 12/15/2009 4:53:21 AM GMT

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-12-15 08:46
    Hmm - I'm working on similar things in CP/M to move files in and out of CP/M. You probably have to go for the harder one - for someone typing a filename they will type MYFILE.TXT, not MYFILE space space.TXT

    Though it still would be stored in a standard 11 byte array. CP/M has multiple routines to handle this sort of thing and I guess it is fairly fundamental to an operating system. I wrote some assembly routines in Z80 to handle the conversions. Just some fairly standard string stuff. Search for the . Pad it out with spaces behind the scenes but only show the user the name without the padding. Except when you want to do a directory listing - then you do want the padding so the names all line up nicely.

    Is this in spin or pasm? If spin, I think there are string routines around somewhere. Search for a character like a dot. In Basic I used to cheat and add 8 spaces then take the left 8 characters.

    Am I on the right wavelength here?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller

    Post Edited (Dr_Acula) : 12/15/2009 9:30:25 AM GMT
  • RossHRossH Posts: 5,519
    edited 2009-12-15 09:01
    @Kye,

    Dr_Acula is right - you should only translate at the edges, never internally - i.e. all user accessible/visible file names should be in the "name.ext" format (both for entry or display) but internally all filenames should be in the standard 11 byte format.

    Normally you would leave it up to the user to do any further formatting (e.g. for listings) - but if you are producing a formatted listing yourself you may want to offer both a bare option that returns just "name.ext"(check the dos "dir /b" cmd) as well as a formatted option that returns "name .ext" so that the columns align nicely.

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-12-15 10:25
    Kye, I agree w Drac & Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • KyeKye Posts: 2,200
    edited 2009-12-15 23:02
    Okay, thanks guys, I just wanted to see if anyone wanted to see raw file names.

    I have a function that lets you type ANYTHING in and it will convert it into a standard 8.3 file name. However, I believe Jazzed noticed when he tried my beta out that the list function prints out the raw names, so I'm looking into making it friendlier. I'll also make sure that all names come out padded.

    Also, should I just format the names as FOOBAR.TXT or Foobar.txt, etc. As in should I change the case?

    Anyway, thanks for the input, I'm going to get everything working before the end of the holidays.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • RossHRossH Posts: 5,519
    edited 2009-12-15 23:42
    Hi Kye,

    I don't think 8.3 filenames should ever have lower case letters (the standards say they had to be uppercase, but since DOS was generally case insensitive some systems may have allowed lower case characters to be used and it made no real difference). But for the best commpatibility you should probably report all file/directory names as upper case even if you find they are lower case on the disk. True lower case (or mixed case) name support required the addition of an LFN - the 8.3 filename should still have been upper case.

    See http://en.wikipedia.org/wiki/8.3_filename

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • kuronekokuroneko Posts: 3,623
    edited 2009-12-16 00:06
    RossH said...
    True lower case (or mixed case) name support required the addition of an LFN - the 8.3 filename should still have been upper case.
    There is an inofficial shortcut (2 undocumented flags) which swaps the case for base name and/or extension. Mixed case within a name component still requires LFN support.

    Just checked some very old FS code of mine, byte 12 and 13 of a normal directory entry are marked as reserved. Byte 12 bit 3 controls the base name, bit 4 the extension. The name itself stays stored in uppercase to keep DOS & Co happy. If the bit is set, the relevant name part has its case toggled (application visibility).

    Post Edited (kuroneko) : 12/16/2009 12:49:47 AM GMT
Sign In or Register to comment.