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----- |