1 |
On Tue, Dec 17, 2013 at 6:53 PM, Greg Turner <gmt@×××××.us> wrote: |
2 |
|
3 |
> On Tue, Dec 17, 2013 at 5:58 PM, Alec Warner <antarus@g.o> wrote: |
4 |
> > Sed is already atomic |
5 |
> > |
6 |
> > antarus@goats5 /tmp/test $ cat foo |
7 |
> > Debian Rocks! |
8 |
> > antarus@goats5 /tmp/test $ strace -e trace=file sed -i -e |
9 |
> > 's/Debian/Gentoo/g' foo |
10 |
> [snip] |
11 |
> > open("foo", O_RDONLY) = 3 |
12 |
> > open("/proc/filesystems", O_RDONLY) = 4 |
13 |
> > open("./sedfDxBxl", O_RDWR|O_CREAT|O_EXCL, 0600) = 4 |
14 |
> > rename("./sedfDxBxl", "foo") = 0 |
15 |
> |
16 |
> Nice demonstration! Been wondering about that... |
17 |
> |
18 |
|
19 |
I originally opened the source code and tried to find the actual rename |
20 |
code...but gave up after about 2 minutes figuring strace would be quicker. |
21 |
I was right ;) |
22 |
|
23 |
-A |
24 |
|
25 |
|
26 |
> |
27 |
> -gmt |
28 |
> |
29 |
> |