[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] readline 8.0 in windows

From: John Darrington
Subject: Re: [Bug-readline] readline 8.0 in windows
Date: Thu, 4 Apr 2019 08:18:20 +0200
User-agent: NeoMutt/20170113 (1.7.2)

As already mentioned, the w32 rename function behaves differently
to the posix one, especially when dealing with atomic moves.

However, if you use the replacement rename module provided with gnulib,
then it brings it very close to posix compliance.   In fact, if you look
at its w32 implementation it works very similar to that suggested below.

On Wed, Apr 03, 2019 at 06:39:14PM -0400, Chet Ramey wrote:
     On 4/3/19 4:54 PM, JohnD wrote:
     > For reference, Windoze does have its own 'rename' like function
     > So I was going to try adding something like:
     > static int
     > history_rename(const char *from, const char *to)
     > {
     > #if defined(_WIN32)
     >   if (!MoveFileEx(from, to, MOVEFILE_REPLACE_EXISTING)) {
     >     return -1;
     >   }
     >   return 0;
     > #else
     >   return rename(from, to);
     > #endif
     > }
     > And change the rename calls to history_rename

reply via email to

[Prev in Thread] Current Thread [Next in Thread]