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.

  • You can download and install Windows 10 in a virtual machine without activating it. After a while it starts to annoy you, and then you just scratch it and do it again. – Thorbjørn Ravn Andersen Apr 16 '18 at 21:25
  • @ThorbjørnRavnAndersen. healthy tin-foil tells me to distrust vm for sufficient isolation. distrust against Intel (M.E. + microcode), leaving little room for that otherwise valid approach. – humanityANDpeace Apr 17 '18 at 8:36
  • Tip of the day: VM's run on the same hardware as the host. So if you don't trust the guest you don't trust the host either. – Thorbjørn Ravn Andersen Apr 17 '18 at 8:48
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.

  • thank you for the information. Besides some other compatibility issus that have existed "disallowed characters in file names", "file name length limitations", and "not providing a file lock for a directory", I will not be able to easily remedy this incompatibility and simply drop Win support – humanityANDpeace Apr 16 '18 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.