use the following search parameters to narrow your results:
e.g. subreddit:pics site:imgur.com dog
subreddit:pics site:imgur.com dog
advanced search: by author, sub...
~2 users here now
Links:
A day in the life of a reactionary programmer
submitted 1 year ago * by fschmidt from self.programming
view the rest of the comments →
[–]fschmidt[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - 1 year ago (4 children)
Yes, it's "rolled over" by renaming it.
[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - 1 year ago (3 children)
What I'm asking is why is this not 2 lines?
If filesize(logfile) >= arbitrary_amount Rename(logfile, current_date + ".log")
It's been a long time since I've done this shit, maybe I'm missing something you're doing
[–]fschmidt[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 0 fun3 insightful - 1 fun - 1 year ago (2 children)
The only reason for more code is to allow multiple rolling backup files. Here is the code, it is quite simple.
[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - 1 year ago (1 child)
I just didn't get why anything was moved, but x0 said it had to do with file descriptor staying open. That makes sense.
[–]fschmidt[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 0 fun3 insightful - 1 fun - 1 year ago (0 children)
That only makes sense if this is done by an outside process. Since I am doing it in code in the same process, I just close the file descriptor, move the file, and open a new file descriptor. So none of the issues mentioned by x0x7 apply.
view the rest of the comments →
[–]fschmidt[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (4 children)
[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (3 children)
[–]fschmidt[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 0 fun3 insightful - 1 fun - (2 children)
[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (1 child)
[–]fschmidt[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 0 fun3 insightful - 1 fun - (0 children)