Unintended Creation of Files


  1. Posts : 1
    Windows 7 Home 32bit
       #1

    Unintended Creation of Files


    Hey guys, I frequently like to pull Notepad up, jot down my thoughts kind of like a journal thing, and then store them in a special folder. There's no special organization yet, they literally are just kind of my random thoughts that I'd like to come back to without forgetting about them, and if they merit further attention, I come back to them. With that said, I noticed a peculiar bug that I think is part of the operating systems fault, not Notepad's.

    The bug happened when I opened one of my thoughts I had written down, realized I needed to give the file a better name than just "thought" as well as correct a typo. First thing I did was fix the typo, did not save the file yet, right clicked on the file icon to rename it, changed the name, and once the file's name had been changed, I hit the exit button with my mouse. It prompted me to save changes, and so I clicked yes, even though it still had the old name as the file to save it as. Sure enough, Windows 7 decided that I needed a file with that name and created a new one for me, effectively give me the same file twice, one with the old name which had newly been created, and one with the name I changed it to.

    While I'm guessing this could be an application error in how the programmer is making API calls to the underlying system, I think this is simply the operating system behaving in an unintended way and it should update any application running with the correct name because while my simple little case required duplication generated only a few bytes, imagine the same thing happening for massive files. I am assuming that Windows 7 allocated separate memory for this, which if it isn't, then my bad, but I would still call it a minor bug, even in that case. What do you guys think?
      My Computer


  2. Posts : 100
    Windows 7 Home Premium 64-bit
       #2

    When saving, use 'Save As' instead of 'Save'.

    Lets you rename the file, change the save location etc.

    There's no need to right-click on icons to change names.

    As you have done it, the file with the NEW name will be the OLD file, and vice-versa.
      My Computer


  3. Posts : 53,363
    Windows 10 Home x64
       #3

    You did create a new file If you had right clicked the unopened files icon , and choosen rename. Then it would rename the file. But the method you used will indeed create a new file, and save it with the new name and changes. the original file will remain, without any changes. As Katanyavich mentioned, using his method would actually make the changes to the original file. A Guy
      My Computer


  4. Posts : 5,642
    Windows 10 Pro (x64)
       #4

    I don't know how long you have been doing this or using a computer. However, I have never seen what you are describing as the file system should work on any OS that I have used. Editing a file in some program, then go though Explore to rename it...does not ever effect the program. It either uses the old name on save, creates a new file with the old name on save, or errors out when it cannot find the file with the old name. I have never seen it work in the way you thought it did.

    Even if Windows was to tell an application whether a file has changed its name or location would still be at the discretion of the application to make that happen. The application would have to be programmed to monitor the file in question for any changes. Windows itself, won't because that is not its job nor should it make assumptions of how an application is going to use a file.

    tl;dr, Not a bug in Windows, not a bug in the application. By design...in every OS I have ever used.
      My Computer


  5. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #5

    Hello Layke1123 and welcome to Seven Forums.

    For what you do, have you considered using some editor other than Notepad?
    A popular recommended choice is Notepad++.
    I prefer Crimson Editor.
    These are free, and there may be other editors someone else could recommend.

    Textpad is another editor I've used and like, but the last i know it's Shareware.
    Put up with nag messages, or pay for the registered version.

    These editors allow viewing/saving/editing multiple files in one Window.
    You could have Thought1, Thought2, etc. files open in one Window at the same time, and easily switch between files.

    I prefer Crimson because it has Print Preview.
    Crimson is end of life (bummer), but it does work with Win 7.
    Notepad++ does NOT have print preview that i know of (bummer), but it does have Rename.

    You would have a bit of a learning curve, but it might well be worth it.
    After you learn these editor(s) copying, editing, saving, viewing new/multiple files is easy, and a nice improvement over Notepad.

    Below are some screen prints so you can see what I'm trying to explain.

    Hope this helps,
    David

    Unintended Creation of Files-crimsonscrprt-01.png

    Unintended Creation of Files-np-scrprt-01.png
      My Computer


  6. Posts : 742
    MS Windows 7 Ultimate 64-bit SP1
       #6

    Windows was behaving normally and did what it was supposed to do when you did the above procedure.

    When you open a text file in notepad, the file is loaded in to RAM and the notepad program also load the file name in RAM while you are editing it. Then you went back to windows explorer and changed the original name of the opened file on the hard disk.

    Normally when a file is opened in an application, the application will lock the file to prevent such untoward changes while it is opened. But it seems that notepad does not do this and you were successful in changing the file name.

    Afterwards, when you tried to save the file in notepad (not Save As), it will look in the folder for the same file and if found will overwrite it. But in this case the file name has been changed by you. So the notepad program does not find the file in the original location. Hence it will create a new file with the same old name upon save command.

    That is how you end up with two different files.

    This normally happens when you try to do more than one thing on a single file. Hence take care not to change the name of the file while it is opened in another application.
      My Computer


  7. Posts : 4
    Windows XP
       #7

    Have you scanned your PC with Antivirus program it seems to be a case of virus program.
      My Computer


  8. Posts : 5,642
    Windows 10 Pro (x64)
       #8

    henrywilliams said:
    Have you scanned your PC with Antivirus program it seems to be a case of virus program.
    What?! Where did you get that foolish idea?
    There is nothin about this case that says virus.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:15.
Find Us