Changeset 712 for trunk/lib/File.cc


Ignore:
Timestamp:
Nov 27, 2008, 4:10:53 AM (13 years ago)
Author:
Peter Johansson
Message:

fixes #337

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/File.cc

    r693 r712  
    204204    if (!node_exist(cache_dir))
    205205      mkdir(cache_dir);
    206     std::ofstream os(cache_file.c_str());
     206    std::string tmp_cache_file(cache_file+"~");
     207    std::ofstream os(tmp_cache_file.c_str());
    207208    stats_.print(os);
    208209    os.close();
     210    rename(tmp_cache_file.c_str(), cache_file.c_str());
    209211    return stats_;
    210212  }
Note: See TracChangeset for help on using the changeset viewer.