Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [gentoo-dev-portage] [PATCH] prevent world file corruption by writing atomically
Date: Wed, 25 Jan 2006 22:21:31
Message-Id: 43D7FAEE.5070303@gmail.com
In Reply to: Re: [gentoo-portage-dev] [gentoo-dev-portage] [PATCH] prevent world file corruption by writing atomically by Zac Medico
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Zac Medico wrote:
5 > Brian Harring wrote:
6 >>> the atomic writing of data in writedict could be gutted out to a
7 >>> derivative of the file class; via that, same underlying atomic update
8 >>> code for writedict and wordfile updates...
9 >
10 > Hmm, override the constructor and close methods to handle the temp file creation and rename, respectively. That seems like a very elegant approach. I'll try that and update the patch.
11
12 Okay, I've created a file-like class called atomic_ostream and it is now used for both write_atomic() and writedict().
13
14 Zac
15 -----BEGIN PGP SIGNATURE-----
16 Version: GnuPG v1.4.2 (GNU/Linux)
17
18 iD8DBQFD1/ru/ejvha5XGaMRAu+eAJoCq972UTt02entqxpdIu6go70o/gCg6JY/
19 RWEpzoZcGX3+Kv1yHnK+tbs=
20 =gfKN
21 -----END PGP SIGNATURE-----

Attachments

File name MIME type
world_write_atomic.patch text/x-patch

Replies