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

system.verbs.builtins.radio.weblog.file.getCategoryFolder

on getCategoryFolder (catname, adrblog=radio.weblog.init (), flHtmlFolder=true) {
	<<Changes
		<<6/23/02; 10:25:45 PM by JES
			<<Respect the htmlCategoryFolderPath preference.
			<<New optional parameter, flHtmlFolder, defaults to true. If false, then return the path pased on adrblog^.prefs.rssCategoryFolderPath -- the RSS folder path. This is needed in the case where the4 HTML and RSS are in different folders -- very rarely the case, but support is needed for the radio.macros.xmlCoffeeMug macro, for example.
		<<1/5/02; 5:15:58 PM by JES
			<<Created.
			<<Given a category name, return the path to the category's folder on disk.
			<<Parameters
				<<catname -- the name of the category
				<<adrblog -- the address of the weblog table -- defaults to the value returned by radio.weblog.init
	local (pc = file.getPathChar ());
	local (adrcat = @adrblog^.categories.[catname]);
	if not defined (adrcat^) {
		scriptError ("Could not get the path to the category folder because there is no category named \"" + catname + "\".")};
	local (catfoldername = adrcat^.fileName);
	local (catsubfolder);
	bundle { //set catsubfolder
		if flHtmlFolder {
			catsubfolder = string.popTrailing (adrblog^.prefs.htmlCategoryFolderPath, "/")}
		else { //rss sub-folder
			catsubfolder = string.popTrailing (adrblog^.prefs.rssCategoryFolderPath, "/")}};
	local (catsfolder = user.radio.prefs.wwwFolder + catsubfolder + pc);
	return (catsfolder + catfoldername + pc)}
<<bundle //test code
	<<dialog.notify (getCategoryFolder ("default"))



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.