Announcement

Collapse
No announcement yet.

While saving text-compare changes: often error message

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • While saving text-compare changes: often error message

    Like BC3, BC4 often gives an error when saving changes you manually made during a text compare.

    Saving a second time usually works. Saving a third time virtually always works.

    It looks like a kind of locking issue, where BC does not retry.

    The majority of cases this happens, this is in either these kinds of directories:

    - (D)VCS repository (SVN, HG, GIT)
    - Cloud shared directory (DropBox, Copy.com)

    On my system, I have these tools installed and running virtually all the time:

    - copy.com
    - dropbox
    - TortoiseSVN
    - TortoiseHG
    - TortoiseGIT
    - SourceTree

    --jeroen

  • #2
    Do you have the exact text of the error message? Running with TortoiseSVN and Dropbox is a fairly common configuration here at Scooter.

    BC3/4's Save command would save a copy of the file, then attempt to overwrite the original. It uses a standard Windows save command to help perform this, and it's generally better and safer than the simpler save method (like Notepad's, which writes directly into the original file; if interrupted can cause corruption).

    This this a link to the Copy.com product? https://www1.copy.com/home/

    Is there any overlap between these folders/services? Are your SVN files within/controlled by dropbox at the same time, for example?
    Aaron P Scooter Software

    Comment


    • #3
      Error message:

      ---------------------------
      Error
      ---------------------------
      Unable to remove the file to be replaced
      ---------------------------
      OK
      ---------------------------

      I saved the file in a directory that is monitored by TortoiseGit, and the Delphi XE5 IDE (didn't have SourceTree running at that moment, and the location is outside the Copy.com monitored directory tree).

      Comment


      • #4
        If you attempt to Rename the file, do you also get an error? Or move or rename with Explorer?
        Aaron P Scooter Software

        Comment


        • #5
          Explorer works fine. Didn't try rename yet.

          What also happens that if this error occurs: an orphan .tmp file in that directory appears with the just saved content.

          Comment


          • #6
            Yes, the orphan .tmp file creation is part of the safer Save method. If we used the same Save method as Notepad, we would write directly into the file. However, if this process is ever interrupted, you would then have a corrupted version. BC3 uses a different (but still provided by Windows) Save function that creates the temporary file first, then overwrites the original. It seems that something is preventing the overwrite step.

            To test Explorer, can you rename the original file after you bump into this error? Then rename the .temp (newer version) into the original file? Does either step throw a new error message?
            Aaron P Scooter Software

            Comment


            • #7
              I have exactly the same problem. If I can help to fix this problem then please let me know

              Comment


              • #8
                korna,

                Do you always have this problem when you save, or only with specific drives or folders?

                If the problem is specific to a network drive, what operating system is running on the server providing the network drive?

                What antivirus software are you running on your computer?

                Do you have any other software that might be monitoring or otherwise affecting the problem folder such as version control software or cloud syncing software like dropbox?

                What version of Beyond Compare are you running? Select "Help > About Beyond Compare" to display your version.
                Chris K Scooter Software

                Comment


                • #9
                  While saving text-compare changes: often error message

                  Hi Guys,

                  I also get the same issue and await a suitable solution.

                  A workaround that works for me is that if I continually try saving the file it will eventually saves successfully save the file but this is not ideal.

                  Also, this issue has only started to happen recently and the only changes I've made recently is upgraded to version 3.3.8 (build 16340) of BeyondCompare and I'm also using Visual Studio 2013 in conjunction with the file that's being saved.

                  Hopefully this additional information may be of value to Scooter in trying to solve this issue.

                  Thanks,
                  Marty
                  Last edited by martygolden; 21-Aug-2014, 06:36 AM. Reason: clarifying tools used...

                  Comment


                  • #10
                    Hello,

                    The Save method we employ on Windows is a standard, provided function. Some programs save in-place, like Notepad. If this process is interrupted, it results in a corrupted file. Other programs, like BC3/4 or Word, save to a temp file. Only once the save is complete is a Rename used to overwrite the original file. If you are seeing this scenario where a rename is failing, it is good to test to see if you are able to manually Delete the original file, then Rename a .temp file in the same folder to the original file's name in the same test location. You will also want to test saving a .txt file on your user's Desktop/ using BC3/4, to see if this is a colliding background task (potentially antivirus) that is location dependent or independent.

                    If you are applying updates, I would suggest updating to the latest BC3.x release (3.3.12), to have all the potential bug fixes and enhancements it provides. All 3.x updates are free for 3.x users.
                    Aaron P Scooter Software

                    Comment


                    • #11
                      Hi

                      I have the same issue (BC4 build 18847)
                      repeating the save quite often fails again
                      a more relayable workaround is to switch to other tab and back before trying to save again

                      A couple of times I tried to search for the process that had the file open with process explorer, found nothing
                      Don't see this kind of problem with other programs
                      And eventual BC4 will success in saving the file, though ocational it leaves a temp file behind

                      Comment


                      • #12
                        Which other programs would you be using? As I mention in my previous post, there are two main strategies programs can use to save a file. The other method writes directly into the file, which avoids compatibility issues in locked down environments but if the process is interrupted would corrupt your file.

                        The most common cause of this issue is either a lack of permission in the folder you are editing the file, or a 3rd party program like a virus scanner that is causing a conflict.
                        Aaron P Scooter Software

                        Comment


                        • #13
                          Hi

                          +1 for a revision of the Save procedure of BC4. I am also suffering the problem reported.

                          I don't remember having this issue with BC3. The saved files are under TortoiseGit control. Other programs, i.e. Notepad++, never give errors when saving.

                          I understand BC4 uses 'Windows standard' function and safer method for saving, but really, the evidence is that we have a very annoying usability problem here. The error message appears again and again, and it gets OK usually when changing windows focus or waiting some time.

                          Comment


                          • #14
                            Hello,

                            Has anything else changed on your system recently? BC3 and BC4 share the same file save method.

                            You are hitting a prompt that loops? Are you in a Text Compare, making an edit to one side, then performing a Save on that side? If you had edits on both sides and closed tab to save both, you would hit two prompts.
                            Aaron P Scooter Software

                            Comment


                            • #15
                              I'm experiencing this problem as well. I have the file open in Visual Studio 2012, and do a "Compare with unmodified..." to compare the changes with what is in my Git repository. In BC4, I undo some of my changes, attempt to save the file, and get the "Unable to remove the file to be replaced" error message. After another attempt or two, the file saves.

                              Perhaps VS 2012 is polling the file to see if anything changed, preventing BC4 from getting exclusive access? Does BC4 have any retry/timeout logic?

                              Comment

                              Working...
                              X