Can you move, rename or replace an open file with current Windows? That's possibly one of the reasons why it's so hard to apply patches without rebooting a Windows box. And an endless annoyance when using a Windows desktop.
Can you remove a logfile on linux/unix while something is using it? Of course you can but the open file will stay around in limbo. It wont free up space, the program that holds it open will write to the deleted file, etc. Most linux programs will let you send it a nohup and it will close and reopen the logfile, that's something I haven't a clue about on windows.
I still pipe logs to a separate process that checks if the logfile is deleted and reopens/creates the logfile, its just easier.
> Of course you can but the open file will stay around in limbo. It wont free up space, the program that holds it open will write to the deleted file, etc.
This is actually a feature, because it makes secure temp files possible.
> I still pipe logs to a separate process that ...
Note that logging is usually done in a separate process anyway, using the Syslog facility.
Your command will make /path/to/logfile fill up all available space on the disk. To truncate that file, which is probably what you wanted to do, you should
That's not the point. On any decent Unix, you can overwrite any shared library that's being used and just reload the program. It's not about log files, but not having to bring down the machine in order to write an important file. That's why windows updates take eons: after the boot there are tons of files that have to be moved or renamed before the system can boot completely.
I still pipe logs to a separate process that checks if the logfile is deleted and reopens/creates the logfile, its just easier.