Question

I'm wondering if there is a way for a process to "lock" a complete folder/directory and not allow any other process (except its child process created using Process.Start) to modify/delete anything in there. I don't mind allow read-only access, but that's not a requirement.

The idea is that MyProcess should be able to acquire a lock on a DIRECTORY (not a file) and not allow any other process to modify the contents of that directory. It is a requirement however that the INHERITED PROCESS (started using Process.Start() from MyProcess) should be able to modify that directory, but no one else.

I'm using C# (Windows environment).

No correct solution

OTHER TIPS

The simple answer is: No. This is not a scenario supported by the operating system.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top