[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] readline 8.0 in windows
From: |
Chet Ramey |
Subject: |
Re: [Bug-readline] readline 8.0 in windows |
Date: |
Wed, 3 Apr 2019 16:29:17 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 4/3/19 4:03 PM, JohnD wrote:
>
> Version: 8.0-release
> Windows 10, mingw64-w64.
>
> I'm attempting to use readline in a mingw compiled project and am seeing
> that the history save is failing. If the history file doesn't exist it is
> working, on having a history file, it fails.
>
> Previously I was using v6.2 without any issues
>
> Printing the status out in the sources to find out where it fails, it is
> failing in histfile_restore when calling the rename function, which looks to
> have been added for version 7.0
>
>
> According to http://www.cplusplus.com/reference/cstdio/rename/ if the dest
> file already exists, the function may either fail or override the existing
> file, depending on the specific system and library implementation.
Well, those are terrible semantics. So much for atomic rename and leaving
newpath in place on a file system error.
I don't use Windows, but you could try adding
unlink(linkbuf);
or
unlink(orig);
before the calls to rename() (or, if you're using a version of readline
distributed by MinGW, file a bug report with them). Let me know if it
works.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://tiswww.cwru.edu/~chet/