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

system.verbs.builtins.file.getPrefsSubfolder

on getPrefsSubfolder (foldername) {
	<<10/31/97 at 8:42:40 AM by DW -- moved to file.getPrefsSubfolder
		<<For Windows, I created a Preferences folder in the same folder as Frontier.root, if it doesn't exist.
		<<Can't do it in the same folder as the Frontier app because frontier.getProgramPath isn't working.
		<<Not sure of Windows culture on this, feedback is welcome.
	local (pathchar = file.getPathChar ());
	case sys.os () {
		"MacOS" {
			local (prefsfolder = file.getSpecialFolderPath ("", "Preferences", true));
			local (userlandfolder = prefsfolder + "UserLand" + pathchar);
			file.sureFolder (userlandfolder);
			local (subfolder = userlandfolder + foldername + pathchar);
			file.sureFolder (subfolder);
			return (subfolder)}}
	else { <<an OS with no preferences folder culture
		local (prefsfolder, subfolder);
		prefsfolder = file.folderFromPath (frontier.getFilePath ()) + "Preferences" + pathchar;
		file.sureFolder (prefsfolder);
		if string.lower (foldername) == "preferences" { // caller doesn't want a sub-folder
			<<Monday, January 19, 1998 at 5:32:55 PM by PBS
			return (prefsfolder)};
		subfolder = prefsfolder + foldername + pathchar;
		file.sureFolder (subfolder);
		return (subfolder)}}



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.