Re: [Tutor] Re: manipulating a file

2005-02-08 Thread Danny Yoo
> >>This simplifies the code down to: > >> > >>### > >>srcfile = open('/var/log/httpd-access.log.bak', 'r') > >>dstfile = open('/var/log/httpd-access.log', 'w') > >>for line in srcfile: > >>if len(line) < 2086: > >>dstfile.write(line) > >>srcfile.close() > >>dstfile.close() > >>### >

[Tutor] Re: manipulating a file

2005-02-08 Thread Reed L. O'Brien
Shitiz Bansal wrote: Hi, I do see a problem. The script is fine, the problem lies else where. Your script is trying to write log.bak to log, it should b other way round. i.e srcfile = open('/var/log/httpd-access.log', 'r') dstfile = open('/var/log/httpd-access.log.bak', 'w') hope that fixes it.