Industry


Ads by TechWords

See your link here


Michael Horowitz's picture
Michael Horowitz

Defensive Computing

Windows 7 fails at file integrity

It goes without saying that an operating system has to provide access to files: open, close, read, write, etc. It should also go without saying that an operating sytem provides file integrity.

When one program has opened a file for the purpose of updating it, no other program should be allowed to update the file at the same time. That would be like a drivers education car with two steering wheels.

Managing concurrent updates is not an operating system task, it's a database task.

I griped before that Windows XP fails this most basic task. Eight years after the release of XP, Windows 7 still fails this most basic undertaking.

THE TEST

To test this, open a .txt file in Notepad. Then open it in Wordpad. In Wordpad enter the word "wordpad", save the file and exit Wordpad. In Notepad, write the word "notepad", save the file and exit Notepad. Open it next, in either program, and you'll see that the file no longer has the word "wordpad".     

The second program (Wordpad in this case) should not be allowed to open the file after the first program (Notepad in this case) has registered its update intent. Millions of lines of code and Windows still can't handle this most basic of tasks.

There is no excuse for this.

What People Are Saying

Wow.

Maybe the OS should also make sure it isn't possible to write stupid articles.

It is a clear lack of knowledge as to how operating systems work and the good reasons that some of the design decisions were made.

Petitioned to remove these articles

This article, along with "Linux file integrity: the same as Windows" by Michael, is based on an obscene lack of knowledge, and the articles together discredit multiple organizations based upon that lack of knowledge.

Therefore, I've sent an email to Joyce Carpenter, Computerworld's Director of Blogs, requesting to have this article removed.

Spend more money on M$ Office

I tend to disagree also, because M$ wants it that way. See, you can have file locking by using M$ Office. So instead of using wordpad, spend more money on an overpriced M$ office suite. Come on, that's what M$ wants you to do. And that is the reason they do the things they do. It's not that M$ has written poor code, they've written money making code.

The WTF meter went off the scale

So because Notepad contains what Michael Horowitz considers to be a bug, Windows is broken?

Riiiiight...

At the risk of perpetuating the stupid-car-analogy meme, that's like complaining that a car is unsafe because it does nothing to stop the driver steering at a brick wall while flooring the gas pedal.

Are you actually trying to say that there's a widely-used mainframe OS that positively prevents a running image from opening a file, reading its contents into core, closing the file, and some time later opening the file again to write out different contents? In other words, it would be impossible to write a dumb app like Notepad?

If so, I can't imagine how awful it would be to develop in such a hellish environment. I can, however, imagine all the ugly hacks that developers would have to implement in order to work around such limitations.

The author is trying to

The author is trying to Windows 7 by putting the title "Windows 7 fails at file integrity". This issue is nothing to do with Windows 7. The locking facility is available to Windows. It is he responsibility of applications to use it based on the need. I think Windows 7 keeps integrity if applications developed with file integrity in mind.
Also don't blame all MS programmers. We can see MS Word keeps file integrity by using file locking. Another example MS SQL server.
So the title must be something like Notepad, Wordpad file integrity problems in Windows (or Windows 7)

So ComputerWorld, don't spoil ur name by posting(or keeping this page) this type of nonsense article or ...

Solution: Stop using Windows

I'll never understand why Windows users continue to put up with all the problems and hassles. I have no problems like this one or any of the countless others because I switched to Linux a year ago. It just works!

I don't know how you guys ever get any work done in a reasonable amount of time.

Oh yeeees! Linux solves file

Oh yeeees! Linux solves file locks with unicorn magic! XD

LOL

Greg D.'s smugness regarding this particular issue is especially amusing since file locks on most UNIX-like operating systems (including Linux) are actually advisory by default [1] [2].

This means a file lock is by default ignored by any program that doesn't actively test for one(unless you go out of your way to explictly configure the filesystem and chmod your file to enforce mandatory locking).

I'm 100% with Michael

I'm 100% with Michael Horowitz on this one. I've been a professional programmer on IBM mainframes for several years and this kind of poor Windows behavior is something we luckily never had to deal with, thank God, that would have been a disaster!

On the contrary...

I, too, am a programmer, and sometimes I very much enjoy the fact that I can open a file up in UltraEdit (a program editor) and the same file in Visual Studio (Microsoft development environment) and switch back and forth between the two and watch or study the changes I make. Yes, I have to be a little more careful to ensure that I do not wipe out what I have done in A, in B, but I find that the extra care is worthwhile because it adds flexibility.

Of course, if I had sharing activated on my computer (I do not) I might feel different. I suppose it depends upon the users' degree of vulnerability.