-11

The Scenario is as follows: I am using Windows XP. Suppose I have a text file in desktop named foo.txt.

  1. I open foo.txt the first time and start making changes and I have not yet saved, so the state of notepad program is that the file foo.txt is open in notepad program and changes are not saved.
  2. Now I go to desktop and open foo.txt again and Windows XP allows me to open foo.txt with its old version without any modifications. The state of the notepad program is that there are two instances of the same file foo.txt open in two different instances of notepad program.
  3. Suppose I am a forgetful person, so I forgot that in the first instance of foo.txt, I have already made some changes. I see my PC and see the second instance which is active and I start making some changes.. Now the state is that there are two instances of the same file with different modifications of mine. And now I save the latest active file(second instance). Then I see the existence of the first instance of the file which is still open.. then I tell OMG.. So natural instinct is that I again open foo.txt which is having the latest changes and then I try to merge the changes from both the instances..

Instead of all this, can Windows detect that the file is already open and point me to the already opened file and allow me to make my changes peacefully??

UPDATE: I wanted to know if Windows 7 has atleast taken care of this issue.. But still the bug exists in Windows 7... :(

6
  • While we all know that Windows is full of bugs, do you think that this behavior would be "unfixed" for 25 years (which is how long Windows and Notepad have existed) if it were really considered a bug? Feb 27, 2012 at 9:44
  • 6
    There is a simple saying: "The machine has no brain so use your own."
    – Mose
    Feb 27, 2012 at 9:45
  • 2
    It's not a bug.
    – Alan B
    Feb 27, 2012 at 9:47
  • I feel bad for application designers at Microsoft, who have to deal with end users. Feb 27, 2012 at 9:48
  • 3
    Its a PICNIC error, Problem In Chair Not In Computer
    – Moab
    Feb 27, 2012 at 18:17

3 Answers 3

6

I would suggest that a bug is a deviation from advertised or reasonably expected* functionality. Microsoft advertised (in the Windows 7 help file) Notepad as:

Notepad is a basic text-editing program and it's most commonly used to view
or edit text files.

No advertisement is made of functionality that maintains only one open copy of any file, and my 'reasonable expectation' of a 'a basic text-editing program' would not include such a feature either. As such, I do not believe that what you describe can be reasonably called a 'bug', but a 'feature request'.

4

This is not a bug but by design.

Notepad doesn't have the concept of locking files (as in "proper" word processors like Word etc.). Therefore what you are seeing is to be expected.

Notepad is only really meant for quick edits to simple text files (such as .bat file). If you want this sort of functionality then you need to install and use something like Notepad++.

1
  • When it comes to a layman who uses the program, he should not be put in a sorry situation. I think it is not a mountainous task for Windows XP developers to extend that locking functionality for Notepad also. Assuming that large number of people still use Notepad. Feb 27, 2012 at 9:41
1

It sounds like you're relying on doing important work with notepad. This isn't wise. Notepad does not perform a file lock on its active files which means any other process is free to open and read/write to your file even while you're working with it in notepad.

You should find an alternative text editor for your work if that is an issue for you but the reality is it's easier to check yourself if the file is open (if it's not shared and potentially network users have access to it) than it is to try and enforce file locking.

2
  • I am not doing important work with notepad. I happened to notice this bug and posted in Superuser. Well I use Notepad++ while I am running Windows and While I use linux, I will be using VI. Feb 27, 2012 at 9:45
  • 1
    It's not a bug, notepad utilises the lock-open-unlock-edit- lock-save-unlock method, which has its advantages and disadvantages. You will need to use another editor to achieve what you want, or write a wrapper for notepad.
    – deed02392
    Feb 27, 2012 at 10:52

Not the answer you're looking for? Browse other questions tagged .