Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: need a function to delete an (empty) directory

need a function to delete an (empty) directory

From: [IDC]Dragon <idc-dragon_at_gmx.de>
Date: Thu, 8 Apr 2004 13:32:46 +0200 (MEST)

I've added the On+Play functionality to recursively delete a directory. When
I was done with it I realized that our remove() function doesn't work on
directories. It internally calls open(), which explicitely checks for the dir
attribute and fails with return code -8.

Does somebody have a rmdir function "in the drawer", or have I overlooked a
possible way?
Directories are in principle ordinary files, but from a collegue I learned
that because of a bug(?) from Microsoft they always have zero size and the
true size needs to be determined by the FAT. Hmm, maybe we don't need to find
out if we're just deleting it.
I don't feel like messing around in that part of the code, would welcome
some help.

Nevertheless I have committed the feature, with the actual directory
deletion commented out. So, for the time being it deletes all files within the tree,
but leaves the directory stucture remaining.

Jörg

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/info
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on 2004-04-08

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy