The answer is pretty simple:
Windows does not allow the removal or renaming of a directory / folder that
- the current directory of any running process (application / service), such as a team process, or
- any subdirectory of the directory to rename is the current directory of the running any process, or
- any file is opened in the directory for renaming or any of its subdirectories by any process using OF_SHARE_DENY_READ, OF_SHARE_DENY_WRITE, OF_SHARE_EXCLUSIVE used when opening the file.
In other words, if the directory itself or any file or subdirectory in this directory or its subdirectories is used by any application, Windows will refuse to rename or delete the directory.
On Unix / Linux, you can delete or rename a directory while it is using 1 or more running processes. The running * nix process must handle a special use case when a directory or file that just managed to access a millisecond does not suddenly exist before that.
source share