8.3 File System Names
Kye
Posts: 2,200
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
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
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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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
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,
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
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