Dear web2py folks,
I am having trouble creating a static file on the fly.
Here is the code in dnload_file/controllers/default.py.
def make_dl():
myurl = URL('static', 'excel.txt')
f = open(myurl,'w')
for i in range(20):
f.write('This is a test %2s\n'%(i))
f.close()
return dict(myurl=myurl)
Here is the ticket Traceback.
Traceback (most recent call last):
File "E:\web2py\gluon\restricted.py", line 194, in restricted
exec ccode in environment
File "E:/web2py/applications/dnload_file/controllers/default.py",
line 80, in <module>
File "E:\web2py\gluon\globals.py", line 149, in <lambda>
self._caller = lambda f: f()
File "E:/web2py/applications/dnload_file/controllers/default.py",
line 21, in make_dl
f = open(myurl,'w')
IOError: [Errno 2] No such file or directory: '/dnload_file/static/
excel.txt'
Any ideas?
Thanks for the help in advance.
Love and peace,
Joe