Why didn't the jackasses make windows tell which program is "using the device"?

Let’s take the first message, “Write operation failed, disk is full.” Usually the real error message is simply “write operation failed,” but some higher level makes the often incorrect interpretation that it was because the disk was full, assuming facts not in evidence. There are many other reasons, like trying to write a 2+GB file to a FAT32 disk, a problem I had recently with an empty 8GB flash drive.

If the person who wrote the original, lowest level routine had passed back something a little better than just “op failed,” the higher level would have a fighting chance, so I’m blaming both parties for the useless or incorrect information.

As an ex-programmer who used to write low level source code, I made a point of writing subroutines that return much better info than just pass/fail conditions. It’s often not that hard; when something fails, you usually know why at that point, but collecting all errors at one point before return destroys this info.

not only that, it gets me how so many of these threads/posts always start from the premise “lol Micro$oft idiots.” Whenever I see some dimp post stuff like that I generally ask to see the multi-user, preemtpive multitasking, protected virtual memory OS that they wrote. Oh, you didn’t? Big surprise.

I don’t think that’s entirely fair. Many of us have written things of similar complexity but maybe not at the same scale as a company like MS/IBM/Apple/Google, etc.

In addition, it’s a reasonable desire to have the system tell you in detail what is going on so problems can be solved quickly and easily. I understand why MS generally takes the approach to problems they do and it’s good for them. But that doesn’t mean it is good for the user. We burn a lot of man-hours at work trying to track down problems in windows environments that have very little information available. In previous environments, we would just look at the log and the system would tell us exactly what the problem was.

It’s not contradictory, but it does require work and a desire to give the user this type of information.

One way to solve the OP problem is to make the lock information available, for example, which processes have locks on this resource. That is how I’ve seen it handled in other OS’s.

Another aspect to the answer to this question involves MS’s desire not to alienate third-party developers or at least to create markets for them whatever their reasons. They deliberately provide, at times, very limited (read almost useless) functionality utilities like disk defragmenter, firewall, etc. for the sole reason of allowing a market to exist for third party developers to still be able to sell better ones. In this case to answer this post I see a flurry of links to privately developed programs that were written to address this particular Windows shortcoming, so I guess the system is working. Microsoft could certainly buy any of these programs later and make them a core part of Windows if they choose, and that is how the majority of Windows components were “developed”.

The Tao’s Revenge, you can’t remove a flash drive if you are currently exploring the folder using Windows Explorer, or if a file on that drive is open.

For example, say that you have Windows Explorer open to that device. If you open up Computer in another Windows Explorer and right-click on your removable drive, you will see the “Eject” option. However, if you try to eject that drive, it will tell you that it is in use (again, due to the first Windows Explorer you have open.)

Note: This behavior is different for CDs. That is, if you repeat the same process using a CD instead of a flash drive, it will actually close the other Windows Explorer window and will eject the CD. It might be different if the CD is writable (my DVD/CD drive is read-only).

If the device is not writable, then there is no harm in just closing the window and ejecting the CD. However, if you are in the middle of writing to the device, then if the system just closed the files and removed the flash drive, it could cause problems for any programs that were expecting that drive to be there.

No matter which course of action the programmers take, they are going to make 1/3 of the users unhappy. (One-third wants it one way, one-third wants it the other way, and one-third don’t understand the issue enough to have an opinion.)

Now, not all programmers are jackasses. Some of us are actually pretty good at what we do and in writing decent error messages. Back in the early 1990s, I inherited a major piece of software, and one of the first things I did was to go through and make sure the error messages were obvious. So, rather than showing “The file could not be opened”, the error message read, “Error 3 (File Permissions) encountered when opening C: emp\foo\bar.dat for reading. (JunkStuff.c, line 248)”.

The end user may or may not be able to do anything with that message, but if they called in to the help desk for our software, we could find and fix the problem. However, having decent error messages cut down on a lot of phone calls because the system admin on the other end had enough information to take corrective action.

Excellent. Even “the file could not be opened” is more info that I often see: “file error.”

And my favorite, which I get from our video server sometimes, “The server encountered an error.” That’s the compete message. Useless.

you most certainly can.

which is different, since a process has a handle open on a file on that volume.

no it doesn’t, at least on the two Windows 7 systems I’ve tried this on just now. as I recall, the XP system I’m stuck with at work is the same. when I select “Eject” I get the notification bubble that it’s safe to remove the drive, and the Explorer window that was displaying the drive’s contents disappears. Simply showing a drive or folder’s contents in Explorer doesn’t prevent you from unmounting the drive.

what might be happening is a “shell extension” might be getting in the way, opening a handle to something on the drive and preventing you from cleanly unmounting it. e.g. anything that adds entries to the Explorer right-click menu is a shell extension; crapware like Winzip does this all the time. Even though it’s not Explorer doing this, the extension gets loaded into Explorer’s process so it looks like Explorer is the culprit.

Sorry if I was mistaken. On my PC here at work, running Windows Vista™ Enterprise, I am unable to eject a flash drive if Windows Explorer is displaying files on that drive. To the best of my knowledge, I have not installed any shell extension products.

Its certainly more complicated that it lets on, but a similar problem is handled nicely and transparently in several programming languages such as haskell. Even python functions can fail gracefully upwards and these can pass concise messages up and out of the application.

Outside of that you just need a journal system - again not impossible - all the major OSes have file systems that feature this. You could have a second one for app crashes(or rather, a more concise one).

So it comes down to communication issues among humans(as was pointed out earlier) and a lack of desire on the part of the publishing houses. Another part of the problem is that crash messages are an excellent tool for software crackers.

Probably, the same reason it doesn’t tell you what an “illegal action” is.

Doesn’t Miranda or something require you to be informed what illegal action you stand accused of?

I am starting to program in MATLAB, so I am getting frustrated by these. “Error in function ‘Foo.’” Okay, which line is causing the problem? Then it reports an esoteric format for functions that I’m supposed to interpret through trial and error.

Windows 98 called. it said “I’ve been dead for 10 years. stop talking about me.”

But can you imagine how slow an OS written in something like Haskell or Python would be? Such an OS would be a complete failure, in that nobody would use it.

Oh, you could certainly design an OS with this built in. But the problem is that buyers don’t want this bad enough to pay the price for it.

Remember that these errors are exceptions – they only happen a very small proportion of the time. An old programming guideline is that you should program for the normal case, not the exceptions. Don’t allow your code for handling exceptions to slow down the normal case.

Such OS’s have been designed, and used in certain special situations. (See fault tolerant or fail-safe systems.) But they are more expensive or slower, and for the main group of computer users, they aren’t willing to pay that. They would prefer OS’s with more features over better error handling.

I got it, and I’m running it, and it shows me a very pretty indented list of which programs are calling which programs, but I don’t see files listed anywhere, How do I use this to show me which process to kill in order to be able to remove my flash drive?

I think a lot of this might have to do with security considerations. Not necessarily that non-verbose error messages are more secure, but rather if you’re not passing up information about other processes you don’t have to think about if passing up that information compromises security or not. In my experience the average person developing software out there is in no way competent enough to make such a decision, so at least a part of this is a good thing.

I’ve always felt that there should be a kernel to user message console that bypasses the application entirely that can include helpful messages like these without any security considerations.

Somewhere in the menu there is a “Find Handle”, type in a name or part of a name of a file and it will find processes using it. You can also select a process and its open files will be listed in the bottom pane.