Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.html.includeFile
on includeFile (fname, pta=nil) { <<Changes <<11/28/01; 6:30:24 PM by DW <<Read the file instead of getting its text from the cache. <<11/12/01; 8:30:17 PM by JES <<Made pta an optional parameter. If nil, then get the page table address with a call to html.getPageTableAddress. <<8/2/01; 5:03:06 PM by JES <<Get the text or the opmlAsText of a file, given the name of the file. <<If the file doesn't exist, then the empty string is returned. <<This verb is used by radio.webserver.pageFilter, to get the text for the navigatorLinks, cascadingStyleSheet, and javaScript macros. if pta == nil { pta = html.getPageTableAddress ()}; local (f); if defined (pta^.radioResponder.atts.[fname]) { f = pta^.radioResponder.atts.[fname]} else { //optimization: only render if pta^.radioResponder.atts.[fname] is defined, meaning the file exists on disk. return ("")}; local (adrcache); radio.file.getFileAttributes (f, @adrcache); local (s); case radio.webserver.getfilemimetype (f) { "text/x-opml" { s = string (adrcache^.outline)}} else { s = string (file.readwholefile (f))}; return (s)}
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.