Hi, How could I append the contents of one zope file to another using Python? What python command should I use to open these files? They cannot seem to be opened by the normal 'open' command. Regards, Jenny _________________________________________________________________ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp
On Tue, Nov 25, 2003 at 09:02:54AM +0000, Jenny Edmondson wrote:
Hi,
How could I append the contents of one zope file to another using Python? What python command should I use to open these files? They cannot seem to be opened by the normal 'open' command.
That's because they're not files, they're objects stored in an object database (the ZODB). Are these File objects, or DTML objects, or Page Templates, or what? -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's PENGUIN LETTUCE-WAVER ! (random hero from isometric.spaceninja.com)
Jenny Edmondson wrote at 2003-11-25 09:02 +0000:
How could I append the contents of one zope file to another using Python?
Zope's "File" objects were not designed for an easy append operation. You must implement "append" by reading the files content ("str(fileObject)") appending your new content to this string and then use "manage_upload" to give the file new content. -- Dieter
participants (3)
-
Dieter Maurer -
Jenny Edmondson -
Paul Winkler