Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I had a directory structure (src/...) created by Cygwin's 7za.exe. From a command prompt I ran rmdir /s /q src.

This resulted in error messages (paraphrasing as my DOS shell has long since overflowed):

Cannot delete src/test/unit/geom

The directory is not empty

Browsing to src/test/unit/geom showed that it was indeed empty, so I ran the same rmdir command again. Same error, but pointing at src/test/unit instead. And my Explorer window that was showing the absence of contents in src/test/unit/geom dropped down to src/test/unit.

Three rmdir executions later, it is fully gone.

This is Windows 7 and set CYGWIN=nontsec had been run. I believe this has been the source of build problems for some time now, but until now I hadn't identified the culprit.

What can I do to avoid this in the future? If it happens again, what should I look for in terms of identifying corrupt aspects of the directory structure?

share|improve this question

marked as duplicate by DavidPostill windows Feb 1 at 20:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

What command interpreter was running as this "command prompt"? Microsoft's CMD? bash? TCC? It's not a "DOS shell", by the way. DOS has nothing to do with it; and you aren't running DOS. – JdeBP Nov 1 '11 at 0:09
@JdeBP DOS shell on Windows 7 == CMD – Raven Nov 1 '11 at 16:55
No, that's not a DOS shell. It's a Win32 program. DOS has nothing to do with it, as I said. Moreover: I already know what comes in the box. That's not the question that you were asked. But I also know that you're the sort of person who installs things like Cygwin. So for the second time: What command interpreter were you using? – JdeBP Nov 1 '11 at 19:09
I am mystified. I tried this and it didn't work, then I tried the exact same command and it did work. Buggy? Circumstances unknown mitigating the behavior? First, it only removed a whole subdirectory tree provided all the directories are empty (apart from having subfolders--) in other words it did not work when files were in the folder. Then it did work with files in the folder. ?! – r_alex_hall Feb 1 at 16:03
up vote 1 down vote accepted

If you can reproduce the problem, try using Sysinternals ProcMon (or FileMon) to see what's happening under the covers. It's been a while since I've look at this stuff but IIRC, cygwin performs some fancy steps to replicate Unix semantics and the results are not always perfect.

share|improve this answer
No repro since I started looking hard at the issue, but if I ever get one I'm confident ProcMon will be the answer. – Raven Jan 7 '12 at 1:42

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