Closed smutt closed 7 years ago
For whatever reason the following IF statement will never evaluate to FALSE.
if int(os.stat(LOG_FNAME).st_size / 1024) < LOG_SIZE:
os.stat(fname).st_size weirdly returns a long on OpenWRT/LEDE, and an integer on my Debian Linux. Could be some other weirdness that I'm not seeing here as well.
Fixed
Still not sure why LOG_SIZE is not respected. Will need to fix this eventually but it's a low prio now.
The below code still does not do what I want:
if not (os.stat(LOG_FNAME).st_size / 1024 > LOG_SIZE): LOG_HANDLE.write(outStr + '\n') else: LOG_HANDLE.close()