You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dan Poirier <po...@pobox.com> on 2010/11/01 16:13:02 UTC

Questions before I add .n feature to rotatelogs

I'm working on a keep-N-files feature for rotatelogs (rename logfile to
logfile.1, logfile.1 to logfile.2, etc up to N) but have a couple of
concerns before I commit it.

1) Is it safe to rename an open file on all platforms? I know Unix is
okay, and testing on Windows 2003 worked, but I'm not sure about older
Windows, NetWare, etc.

2) All the current schemes have the nice property that rotatelogs can
try to open the new logfile before closing the old one, so if the open
fails, it can truncate and re-use the still-open old logfile.  If I
can't rename the old file before closing it, I'll have to close it and
rename it before opening the new one, since the new one will have the
same name.  Is that much of a concern?

Thanks,
Dan