Monday, November 08, 2010 at 12:02 AM.


on deleteFolder (path) {
	local (f);
	if not file.exists (path) {
		scriptError (file.fileFromPath (path) + " doesn't exist.")};
	if not file.isFolder (path) {
		scriptError (file.fileFromPath (path) + " is a file, must be a folder.")};
	fileloop (f in path) {
		if file.isFolder (f) {
			if not file.deleteFolder (f) {
				return (false)}}
		else {
			if not file.delete (f) {
				return (false)}}};
	return (file.delete (path))}

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.