Menu

#63 patch: **** Can't rename file AGAIN!

Patch
closed
GnuWin
Binaries (396)
5
2014-08-18
2003-03-26
No

I'm trying to patch GVIM sources on my machine with
WinXP Pro installed (tested with patch-2.5.4-1 and
patch-2.5.7-alpha):

patch.exe -p0 < 6.1.1-100

After executing this command I'm receiving an error:

patching file src/edit.c

patch: **** Can't create file 'C:
\WINDOWS\TEMP/poa01996' : File exists

From time to time there is another error:

patch.exe: **** Can't rename file 'C:
\WINDOWS\TEMP/poa01224' to src/edit.c : File exists

Test runs successful if I'm adding the option 'dry-run' to
the command line:

patch.exe --dry-run -p0 < 6.1.1-100

I tried to 'escape' wrong slash using 'quoting-style'
option, but this does not helps. Don't you know: what
may be wrong?

Thank you.

Discussion

  • GnuWin

    GnuWin - 2003-04-20

    Logged In: YES
    user_id=217802

    Could it be that the files to be patched are read-only? Then
    patch may fail to move a temporary file to the original one.

     
  • Valery Kondakoff

    Logged In: YES
    user_id=396997

    No, I checked this twice. The sources to be patched and the
    diffs are not read-only. And I have full access to the sources
    and to c:\windows\temp. What else may be wrong? (It's
    interesting, that I can patch these sources on my home
    machine with WinXP, but can't do the same on work machine
    with WinXP (the same configuration)).

    There is a log:
    C:\VIM\vim61>D:\TOOLS\GNUWIN32\PATCH\bin\patch.exe -p0
    < 6.1.1-100
    patching file src/edit.c
    patch: **** Can't create file 'C:\WINDOWS\TEMP/poa01224' :
    File exists

    C:\VIM\vim61>attrib src\edit.c
    A C:\VIM\vim61\src\edit.c

    There is no such a file (poa01224) in c:\windows\temp. (I
    think it is not even created. Maybe the problem is in wrong
    'slash'?).

     
  • GnuWin

    GnuWin - 2003-06-07

    Logged In: YES
    user_id=217802

    A new release of patch-2.5.4 is available from
    http://gnuwin32.sourceforge.net/. I hope it fixes the problems
    you reported. Could you test this?

     
  • Valery Kondakoff

    Logged In: YES
    user_id=396997

    No, sorry, it seems the problem still exists:
    C:...\CPP\VIM\vim61>patch.exe -p0 --verbose <D:
    \PATCHES\6.1.1-100
    Hmm... Looks like a new-style context diff to me...
    The text leading up to this was:


    ...
    |Patch 6.1.001
    ...
    |*** ../vim-6.1/src/edit.c Sun Mar 24 19:23:31 2002
    |--- src/edit.c Wed Mar 27 19:25:13 2002


    Patching file 'src\edit.c' using Plan A...
    Hunk #1 succeeded at 3669.
    Hunk #2 succeeded at 3820.
    Hunk #3 succeeded at 3848.
    Hunk #4 succeeded at 3905.
    patch: **** Can't rename file 'C:\WINDOWS\TEMP/poa00876'
    to
    'src\edit.c' : File exists

    I was using 'patch.exe' dated 07.06.03 (114176 bytes)

     
  • GnuWin

    GnuWin - 2003-06-10

    Logged In: YES
    user_id=217802

    The only way that I can reproduce this is when src\edit.c
    indeed already exists, and the 'cannot rename' message is
    then a valid one.
    Could you perhaps provide a small example of a diff file and a
    file to be patched, together with the appropriate command
    line, that shows the bug?

     
  • Valery Kondakoff

    Logged In: YES
    user_id=396997

    Excuse me, it seems I don't understand smth important. I'm
    patching Gvim sources. The sources are in .\src subdirectory.
    And yes, the file .\src\edit.c exists - it is the file that is
    patched!

    The command line and the patch and the program output are
    partially available in my last comment. If there is smth wrong
    with them?

    As far as I understand the patch is firstly applied in
    windows\temp directory and then patched file is copied over
    the original file (src\edit.c). And this works on one of my
    machines, but generates error 'Can't rename file' on another
    one (I don't know why).

    Am I doing smth wrong?
    Thank you for your help!

     
  • GnuWin

    GnuWin - 2005-01-04

    Logged In: YES
    user_id=217802

    This bug has been fixed. A new release is available through
    http://gnuwin32.sourceforge.net/