External methods can certainly use the built in Python "open" function. However, I'd shudder at the thought of creating an "Excel" file rather than a plain-text CSV (comma separated values) file, since the former is (I presume) closed-source and binary, whilst the latter is simple text, human readable and should be easy to make. However, it sounds like this part might already be working, so YMMV. Also, it sounds like you're intending to have Zope/Plone generate the file, and then placing it on a file system so that users can get at it "from anywhere". Keep in mind that if the data in MySQL changes, the file system version won't (necessarily) have been updated.... hence it'll be out of date with no indication to the viewer. To solve that, presuming you're only providing file system access for MSWindows clients, you could put a MSW-style-URL-link file on the shared file system. Then you would have semi-transparent access to the current data through a file system "file" (if there is anonymous access or authentication transparent to the user). And if you *DO* write the file to the file system, be sure to test for concurrent read/write conflicts on the file (and it's timing related, so do lots of read-hits while writing, or use a write-and-rename scheme. (I could recount a horror story of intermittently lost data at the customer site that I never did duplicate locally). Either way, good luck. Kate Legere wrote:
Well, we're working on porting it over from linux but at the moment that's my only option... I just had this impression that I'd seen something whereby I could write to the filesystem using an external method.
Kate
-----Original Message----- From: hpinson@indepthl.com [mailto:hpinson@indepthl.com] Sent: Thursday, November 17, 2005 1:06 PM To: Kate Legere; zope@zope.org Subject: RE: [Zope] probably a simple answer..
Well, I can suggest how I might approach it, which might be different than what you intend... but for what it is worth...
First, run Zope on a Windows server so you can interact with an Excel file as an ODBC Data Source (DSN). You could setup a Zope/ODBC adaptor Product like zodbc or (better) mxODBC in Zope. Then in Windows control panel, setup an ODBC DSN to the Excel file, and create a Zope/ODBC connection in the ZMI. Then you might be able to use ZSQL methods, or Python if you perfer, perhaps using SQL or the Windows API, to write to the Excel spreadsheet. You might have to use some sort of external file storage for the Excel file, i.e. I'm not sure how you could store the Excel file in the ZODB and still interact with it and expose it through Zope, though that might be possible.
Like Andreas said, you can't write to a users file system directly, if that's what you meant.