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

on backupRendering (relativepath, filetext) {
		<<10/27/02; 2:28:08 AM by JES
			<<Only use file.writeTextFile for rendered files. For all others use file.writeWholeFile.
		<<12/20/01; 1:21:30 AM by JES
			<<Use file.writeTextFile to save the backup file, instead of file.writeWholeFile.
		<<12/17/01; 6:34:45 PM by DW
			<<Example of relativepath: stories/2001/12/15/testingLegacyUrls.html
	if {
		local (pc = file.getpathchar ());
		local (f = + string.replaceall (relativepath, "/", pc));
		local (mimetype = radio.webserver.getFileMimeType (f));
		local (flrender = false);
		if defined ([mimetype]) {
			flrender =[mimetype]};
		file.surefilepath (f);
		if flrender {
			file.writeTextFile (f, filetext, 'TEXT', user.html.prefs.textFileCreator)}
		else {
			file.writeWholeFile (f, filetext)}}}

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.