gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Saving with lower-case letters

#156973 - thegamefreak0134 - Sat May 17, 2008 3:27 am

I just got my libfat to work for the first time, so my drawing program that I am working on can load and save files from the card. That's really neat, with one small issue. Whenever I save files, the filename is in ALL CAPS. Is there any way around this? I'm mainly worried that if a similar filename exists with different casing that it may cause issues, as I'm not sure what behavior to expect.

Thanks!

-gamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#156974 - Dwedit - Sat May 17, 2008 3:58 am

Use a filename which isn't a dos 8.3 filename to get lowercase.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#156980 - silent_code - Sat May 17, 2008 9:37 am

you know that song "don't fear the sourcecode"? :^p
my advise: test it out... after all, it's your job. ;^D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#156984 - thegamefreak0134 - Sat May 17, 2008 10:54 am

silent_code wrote:
you know that song "don't fear the sourcecode"? :^p
my advise: test it out... after all, it's your job. ;^D


And what on earth does that have to do with the price of tea in china? ;-)

I can understand that it will default to all caps for a DOS 8.3 filename. I was just wondering if there was a way to disable it. I'm OK with it either way, it won't really break anything that I can tell, it's just a little gross to me.

-gamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#157015 - Dwedit - Sat May 17, 2008 8:22 pm

I don't think libfat currently implements Microsoft's extension for lowercase short filenames.

The Windows XP way of doing lowercase or mixed case short filenames:
Byte 0x0C in a directory entry:
Set bit 0x08 to make the basename lowercase
set bit 0x10 to make the extension lowercase

For Mixed Case filenames:
Create a LFN entry for the file, but keep the short filename the same.

Maybe we should modify Libfat to do this stuff.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#157023 - tepples - Sat May 17, 2008 8:50 pm

Chishm has made a pre-release version of libfat that (among other things) handles filename case properly. I have it installed on my copy of devkitARM as "libfat-pre" (<fat-pre.h> and -lfat-pre).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#157025 - silent_code - Sat May 17, 2008 8:58 pm

EDIT: don't bother reading, follow tepples' advise.

libfat is open source, you know.
chinese tea... that's original! (at least to me) :^D "it makes no sense!"
just test it out and see if conflicts arise. if they do, you may be able to modify the lib as needed.

i'm proably going to stop posting in this thread, because i can't help you any more than encouraging to take a look of the lib's inner workings. sorry!
good luck. :^D

happy coding!
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.

#157657 - thegamefreak0134 - Tue May 27, 2008 6:03 pm

Well if it's an issue with libfat, I'll be nice and patient and wait for the updated version. I have no issues with that.

And yes, I was able to confirm (finally got my keyboard routine going in the program) that longer filenames are getting cased properly, as you said they would. Odd issue.

-gamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]