6

Being aware that the family of Windows OSes uses mandatory file locking while POSIX family systems use advisory lock, I was wondering if Windows is capable to have a directory structure renamed, while it contains one or more files that have been locked the Windows way?

Motivation: I have no access to a Windows machine, but having gone the extra mile in developing in a cross-platform way already, knowing if Windows can do that would help me out a lot. Also provided, that Window's mandatory file lock mechanism is such a delight, researching the web to answer my question myself, is complicated as the web is bloated with people struggling to get rid of Windows file locks.

1 Answers1

11

No, you cannot rename a folder which contains locked files.

What can happen if you attempt this in a more advanced way (like using a file manager): a new folder will be created with the target name, all files that are not locked will be moved there and the initial folder will remain as-is with the locked files.

Overmind
  • 10,308