This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Feature Request: remove empty folders

Tags: None
(comma "," separated)
futwick
Registered Member
Posts
10
Karma
0
(Apologies if an option for this already exists but I have not found one.)

After 12 months of use, importing music from various other sources, my music collection has got lots of empty folders.  This has happened because over the months I have retagged and reorganised files.  Is there an automatic way to remove empty folders (and/or folders that contain no music files) from my collection?
Galim
Registered Member
Posts
12
Karma
0
find -depth -type d -empty -print -exec rm -r {} \;
futwick
Registered Member
Posts
10
Karma
0
That was easy, thanks!  :smilie:

Seems I wasn't the only one wondering how to do this - http://ubuntuforums.org/showthread.php?t=375491 - would it be hard to add an option (or script) so that Amarok did this automatically when organising files?
User avatar
dangle_wtf
Moderator
Posts
1252
Karma
0
Amarok *does* remove the directory if it's completely empty. If you have other related items in the directory like images, text files etc, Amarok will not delete it for safety reasons - imagine the stink... "Amarok suxorz it deleted all my other stuff!!111" ;)


"There are two theories to arguing with women. Neither one works."
.
If men could get pregnant, we'd learn the true meaning of "screaming nancyboy wuss"
futwick
Registered Member
Posts
10
Karma
0
That's odd, Amarok had not deleted them on my Ubuntu Gutsy installation, I had around 30 empty folders (no cover art, no text files, just empty folders).
User avatar
dangle_wtf
Moderator
Posts
1252
Karma
0
Could be a ubuntu quirk, although I wouldn't think so - no idea what's happening then. It works on both my gentoo installation, and on os x. It's possible there are permissions issues where the files within a dir are able to be deleted but you don't have permission to delete the dir. Could be worth checking.


"There are two theories to arguing with women. Neither one works."
.
If men could get pregnant, we'd learn the true meaning of "screaming nancyboy wuss"


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]