MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1ww8229/cloudoverkill/pdjup4c/
r/ProgrammerHumor • u/object322 • Oct 02 '26
267 comments sorted by
View all comments
Show parent comment
37
I handle this by periodically copying the log file, renaming the copy, and only giving users access to the copy.
Copy isn’t up to date? Just wait 5 minutes.
Also, it’s me. I’m the user who needs to be protected from opening the log file and preventing the next write.
7 u/AyrA_ch Oct 03 '26 In these situations I just open the log file myself. If I keep a handle that's shareable open then all other applications must also open the file in shareable mode and thus cannot lock out other applications. 3 u/ArjixGamer Oct 03 '26 Just use Linux where one can't lock a file
7
In these situations I just open the log file myself. If I keep a handle that's shareable open then all other applications must also open the file in shareable mode and thus cannot lock out other applications.
3 u/ArjixGamer Oct 03 '26 Just use Linux where one can't lock a file
3
Just use Linux where one can't lock a file
View all comments
Show parent comment
37
u/Unable-Log-4870 Oct 03 '26
I handle this by periodically copying the log file, renaming the copy, and only giving users access to the copy.
Copy isn’t up to date? Just wait 5 minutes.
Also, it’s me. I’m the user who needs to be protected from opening the log file and preventing the next write.