Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.upstream.callbacks.upstreamFileRendered.backupRendering
on backupRendering (relativepath, filetext) {
<<Changes
<<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
<<Created.
<<Example of relativepath: stories/2001/12/15/testingLegacyUrls.html
if user.radio.prefs.flBackupRendering {
local (pc = file.getpathchar ());
local (f = user.radio.prefs.renderingBackupFolder + string.replaceall (relativepath, "/", pc));
local (mimetype = radio.webserver.getFileMimeType (f));
local (flrender = false);
if defined (user.radio.prefs.typesToRender.[mimetype]) {
flrender = user.radio.prefs.typesToRender.[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.