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

system.verbs.builtins.radio.userInterface.saveFolder

on saveFolder (adrtable, folder, dateLastSave) {
	<<Changes
		<<8/11/03; 10:46:04 PM by JES
			<<Added support for writing out text and HTML files.
	local (flwrite = true);
	if file.exists (folder) {
		if dateLastSave >= timemodified (adrtable) {
			flwrite = false}};
	local (adr, extension, fileType, fileCreator, fileText, f);
	for adr in adrtable {
		if typeof (adr^) == tabletype { //recurse
			radio.userInterface.saveFolder (adr, folder + nameof (adr^) + file.getpathchar (), dateLastSave)}
		else {
			case typeof (adr^) {
				binaryType {
					case getbinarytype (adr^) {
						'gif ';
						'GIFf' {
							extension = ".gif";
							fileType = 'GIFf';
							fileCreator = user.radio.prefs.imgFileCreator;
							fileText = adr^};
						'jpg ';
						'JPEG' {
							extension = ".jpg";
							fileType = 'JPEG';
							fileCreator = user.radio.prefs.imgFileCreator;
							fileText = adr^};
						'HTM ';
						'htm ';
						'HTML';
						'html' {
							if system.environment.isMac {
								extension = ".html"}
							else { //windows
								extension = ".htm"};
							fileType = 'TEXT';
							fileCreator = user.html.prefs.textFileCreator;
							fileText = string (adr^)};
						'TXT ';
						'txt ';
						'TEXT';
						'text' {
							extension = ".txt";
							fileType = 'TEXT';
							fileCreator = user.html.prefs.textFileCreator;
							fileText = string (adr^)}}};
				outlineType {
					extension = ".opml";
					fileType = 'OPML';
					fileCreator = Frontier.id;
					fileText = op.outlineToXml (adr)}};
			f = folder + nameof (adr^) + extension;
			if not file.exists (f) {
				flwrite = true};
			if flwrite {
				file.surefilepath (f);
				file.writewholefile (f, fileText, fileType, fileCreator)}}}}



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.