[Zope] File handling under Zope
Dieter Maurer
dieter@handshake.de
Thu, 26 Jul 2001 21:50:11 +0200 (CEST)
Kerekes Lajos writes:
> I'd like to make files in the OS (Linux), under Zope.
> I try this, but it doesn't work.
> DTML method:
> <dtml-call expr="writeFile(this(), id='test')">
>
> Python Script "writeFile":
> filename = '/tmp/' + id
> file = open(filename, 'w')
> file.write('foo, bar, text\n')
> file.close
>
> But I get an error:
>
> Error Type: NameError
> Error Value: open
Use an External Method (rather than Python Script).
"open" is a really dangerous operator not allowed in TTW (Through The
Web) contexts such as Python Script.
Dieter