D
Dfenestr8
Hi.
I have a problem with a subroutine in a cgi script that's supposed to
return the byte location at the end of a file, which the script then
stores as a hidden input on a web form.
Unfortunately, even though it works fine in the python shell, in the
cgi-script it always returns "0". That's no use to me at all.
Here's the subroutine......
def getLastByteLoc(log):
#open log file
f = open(log)
#seek to end of log file.
f.seek(0,2)
location = f.tell()
f.close()
return location
I have a problem with a subroutine in a cgi script that's supposed to
return the byte location at the end of a file, which the script then
stores as a hidden input on a web form.
Unfortunately, even though it works fine in the python shell, in the
cgi-script it always returns "0". That's no use to me at all.
Here's the subroutine......
def getLastByteLoc(log):
#open log file
f = open(log)
#seek to end of log file.
f.seek(0,2)
location = f.tell()
f.close()
return location