[tomboy] Added buffer flushing to disk for changed note
- From: Jared L Jennings <jjennings src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tomboy] Added buffer flushing to disk for changed note
- Date: Fri, 5 Jul 2013 15:35:35 +0000 (UTC)
commit b962005173d8a4aa3d6a6845312abd476ac32b82
Author: Alex Tereschenko <frozen and blue gmail com>
Date: Sun Apr 14 18:19:03 2013 +0200
Added buffer flushing to disk for changed note
Tomboy/Note.cs | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/Tomboy/Note.cs b/Tomboy/Note.cs
index 6423e4d..bd64d36 100644
--- a/Tomboy/Note.cs
+++ b/Tomboy/Note.cs
@@ -1487,8 +1487,11 @@ namespace Tomboy
{
string tmp_file = write_file + ".tmp";
- using (var xml = XmlWriter.Create (tmp_file, XmlEncoder.DocumentSettings))
- Write (xml, note);
+ using (FileStream fs = new FileStream(tmp_file, FileMode.Create, FileAccess.Write)) {
+ using (var xml = XmlWriter.Create (fs, XmlEncoder.DocumentSettings))
+ Write (xml, note);
+ fs.Flush(true);
+ }
if (File.Exists (write_file)) {
string backup_path = write_file + "~";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]