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 > Moving files on FAT?

#83193 - tepples - Sun May 14, 2006 1:42 am

I can't see anything in Chishm's library to rename or move files or directories on a FAT file system. DSOrganize can rename files but its source code is not available for download. Am I missing something in the docs or header, or will this be implemented, or is it a WONTFIX?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#83202 - chishm - Sun May 14, 2006 2:22 am

Currently not implemented because of the way it removes directory entries. At the moment it only deletes the short file name, leaving an orphaned LFN, which isn't good, but won't cause long term disc damage.

If you want to move or rename a file currently, you'll need to open the destination, open the source, copy the source to the destination, close the source, then remove the source.

I should have this fixed next release. It's looking like I'll be doing a major rewrite, so don't expect anything soon.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#83215 - josath - Sun May 14, 2006 3:28 am

dsoranize is pretty slow in renaming (there's a progress bar), so I have a feeling DragonMinded is simply copying then deleting original.

#83235 - Dwedit - Sun May 14, 2006 9:53 am

Duplicating the data seems very wasteful, seeing as a directory entry is just a pointer to the first cluster. Making a new entry for a zero byte file, then swapping the first cluster seems more reasonable.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#83237 - MaHe - Sun May 14, 2006 10:07 am

josath wrote:
dsoranize is pretty slow in renaming (there's a progress bar), so I have a feeling DragonMinded is simply copying then deleting original.


Exactly :)
_________________
[ Crimson and Black Nintendo DS Lite | CycloDS Evolution | EZ-Flash 3-in-1 | 1 GB Transcend microSD ]