Monday, November 08, 2010 at 12:03 AM.
system.verbs.builtins.html.fileWriters.file.write
on write (adrData, path, type, creator, creationDate, adrPageTable, adrStorage) { <<This script is called whenever a file needs to be written somewhere. <<Parameters: <<adrData: this is the address of data the file should contain. <<path: path is a relative, /-delimited path. <<It's relative to the ftpSite^.folder. <<type: the file type. <<creator: the file creator. <<creationDate: should be the creation data of the file. <<adrPageTable: the address of the current page data table. <<adrStorage: the address of private storage for this file writer for this session. <<This script doesn't have to write the file immediately -- <<it could defer writing until the shutdown script is called. local (f = html.getPref ("siteRootFolder", adrPageTable)); f = f + string.replaceAll (path, "/", file.getPathChar ()); file.sureFilePath (f); file.writeWholeFile (f, adrData^, type, creator, creationDate); return (true)}
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.