[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: command for swapping of two files or two dirs?
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: command for swapping of two files or two dirs? |
Date: |
Fri, 26 Mar 2021 22:40:28 +0100 |
you may learn about cgroups and freezing elements
i dont, sorry
On Fri, Mar 26, 2021 at 10:34 PM Eli Schwartz <eschwartz@archlinux.org> wrote:
>
> On 3/26/21 5:21 PM, Peng Yu wrote:
> > The problem is that the swap based on multiple commands is not atomic.
> >
> > With multiple commands, wouldn't it cause complications for error
> > recovery? Also, is it safe? If there is any malicious program delete
> > some files during the process?
>
>
> If you feel the need for "atomic" swapping, then rename/renameat being
> run three times very fast in a single command written in C, will still
> not be atomic -- merely fast.
>
> You're going to need to figure out how to implement this at the
> filesystem or kernel level, not as a "well-maintained command".
>
> Or, you may give up on formally guaranteed atomicity, and use 'mv' three
> times fast.
>
> --
> Eli Schwartz
> Arch Linux Bug Wrangler and Trusted User
>
- command for swapping of two files or two dirs?, Peng Yu, 2021/03/26
- Re: command for swapping of two files or two dirs?, Alex fxmbsw7 Ratchev, 2021/03/26
- Re: command for swapping of two files or two dirs?, Alex fxmbsw7 Ratchev, 2021/03/26
- Re: command for swapping of two files or two dirs?, Greg Wooledge, 2021/03/26
- Re: command for swapping of two files or two dirs?, Reuti, 2021/03/26
- Re: command for swapping of two files or two dirs?, Alex fxmbsw7 Ratchev, 2021/03/26
- Re: command for swapping of two files or two dirs?, Peng Yu, 2021/03/26
- Re: command for swapping of two files or two dirs?, Reuti, 2021/03/26
Re: command for swapping of two files or two dirs?, Alex fxmbsw7 Ratchev, 2021/03/26