Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-03 Thread Pádraig Brady
On 02/03/2024 23:18, Petr Malat wrote: On Sat, Mar 02, 2024 at 01:59:31PM +, P??draig Brady wrote: On 02/03/2024 12:46, Dominique Martinet wrote: Thanks for remembering me; didn't try the patch yet but overall looks good to me. Just one nitpick on the not supported message check: P??draig

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-02 Thread Petr Malat
On Sat, Mar 02, 2024 at 01:59:31PM +, P??draig Brady wrote: > On 02/03/2024 12:46, Dominique Martinet wrote: > > > > Thanks for remembering me; didn't try the patch yet but overall looks > > good to me. > > > > Just one nitpick on the not supported message check: > > P??draig Brady wrote on S

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-02 Thread Petr Malat
Hi! On Sat, Mar 02, 2024 at 11:01:42AM +, Padraig Brady wrote: > > > I have modified mv, because for me it would be a logical place where > > > to look for such a feature, and to make something usable, it must be > > > easy to find. > > > > I used "mv -x" for it, but if you have a strong prefe

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-02 Thread Rob Landley
On 3/2/24 05:01, Pádraig Brady wrote: > Ok so there seems to be a bit of consensus for adding this to mv. ... > So how about -x,--swap as the short and long options? Works for me. > Should we add this to install(1) ? No opinion. Rob

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-02 Thread Pádraig Brady
On 02/03/2024 12:46, Dominique Martinet wrote: Thanks for remembering me; didn't try the patch yet but overall looks good to me. Just one nitpick on the not supported message check: Pádraig Brady wrote on Sat, Mar 02, 2024 at 11:01:42AM +: + if (renameatu (AT_FDCWD, file[0], AT_FDCWD,

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-02 Thread Dominique Martinet
Thanks for remembering me; didn't try the patch yet but overall looks good to me. Just one nitpick on the not supported message check: Pádraig Brady wrote on Sat, Mar 02, 2024 at 11:01:42AM +: > + if (renameatu (AT_FDCWD, file[0], AT_FDCWD, file[1], > +

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-02 Thread Pádraig Brady
On 02/03/2024 01:41, Rob Landley wrote: On 3/1/24 05:05, Petr Malat wrote: Hi! On Fri, Mar 01, 2024 at 09:18:31AM +, Padraig Brady wrote: On 29/02/2024 22:02, Petr Malat wrote: renameat2() syscall allows atomically swapping 2 paths on one file system. Expose this ability to the user using

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-01 Thread Kaz Kylheku
On 2024-03-01 01:18, Pádraig Brady wrote: > I agree this is useful functionality, > but the thinking is we should add this to a "replace" utility > rather than to mv. I made a "swap file-a file-b" utility in the early 1990s. Needless to say, there was no system call for doing it atomically. I di

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-01 Thread Rob Landley
On 3/1/24 05:05, Petr Malat wrote: > Hi! > On Fri, Mar 01, 2024 at 09:18:31AM +, Padraig Brady wrote: >> On 29/02/2024 22:02, Petr Malat wrote: >> > renameat2() syscall allows atomically swapping 2 paths on one >> > file system. Expose this ability to the user using -s option. >> > >> > * NEWS

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-01 Thread Rob Landley
On 3/1/24 03:18, Pádraig Brady wrote: > On 29/02/2024 22:02, Petr Malat wrote: >> renameat2() syscall allows atomically swapping 2 paths on one >> file system. Expose this ability to the user using -s option. >> >> * NEWS: Mention the new option > > Thanks for the patch. > > That was suggested p

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-01 Thread Petr Malat
Hi! On Fri, Mar 01, 2024 at 09:18:31AM +, Padraig Brady wrote: > On 29/02/2024 22:02, Petr Malat wrote: > > renameat2() syscall allows atomically swapping 2 paths on one > > file system. Expose this ability to the user using -s option. > > > > * NEWS: Mention the new option > > Thanks for the

Re: [PATCH] mv: add --swap (-s) option to atomically swap 2 paths

2024-03-01 Thread Pádraig Brady
On 29/02/2024 22:02, Petr Malat wrote: renameat2() syscall allows atomically swapping 2 paths on one file system. Expose this ability to the user using -s option. * NEWS: Mention the new option Thanks for the patch. That was suggested previously: https://lists.gnu.org/archive/html/coreutils/2