What about having the grep executable opened up twice? It makes more sense if the application writer takes care of that through IPC with its other instances/sessions.And suppose you have two iterations of Notepad open on Windows....
This is one reason why I don't like Windows' approach of treating two instances of the same executable as completely distinct.
All editors I've used warn me if the file has been changed before saving using the same approach as Jadzia states. That's a problem with Notepad being a dumb program we shouldn't use. For example, vim checks the last modification time and also creates a swap file which gives you a warning if you open the same file twice, warns you if your last edit session crashed and allows you to restore it. That's job of the application, although the OS also provides one - file locking.And suppose you have two iterations of Notepad open on Windows with the same file and you are using one of them to write down information you get over the phone. You might at some point save and close it, forgetting and leaving the other open. Later, when you decide to close the other, you had better not save it, because you'll be destroying information you had recorded and saved. A new OS and GUI should rein in that booby trap. Programmers of some applications know about that problem and don't let it happen with their software.
Though locking in Windows was somewhat queer as far as I can remember.