|
inline |
Save an object into a file.
t | object to save |
where | filename of the target file |
where
. If this succeeds, data is serialised into the temporary file and the temporary file is then moved into where
. If the temporary file creation fails, the file where
is created and data serialised into it directly. The former has the advantage that where
does not exist until it is ready to be read in by other tools. However, e.g. when serialising into /dev/null
, this approach fails (we cannot create a file /dev/.null.syten_tmp_part
).References std::string::c_str(), std::ofstream::open(), std::rename(), std::string::rfind(), serialise_configuration(), std::strerror(), and SYTEN_ASSERT_MSG.
Referenced by do_apply_op(), syten::T3N::TDVP::Worker::do_step(), syten::Pyten::expose_syten_class(), orthogonalise_run(), syten::MPS::DMRG::PDMRG::run(), syten::T3N::DMRG::Run::run(), syten::T3N::TDVP::Worker::run(), syten::MPS::TDVP::LBOWorker::run(), syten::MPS::TDVP::PTDVP< enable >::run(), syten::MPS::QcLatticeGenerator::save(), syten::T3N::QcLatticeGenerator::save(), syten::Krylov::StateWrapper< StateT, TruncT >::save(), save(), syten::MPS::TEBD::save_state(), syten::MPS::DMRG::LBOPDMRG::saveState(), syten::T3N::DMRG::Run::saveState(), syten::MPS::TDVP::PTDVP< enable >::saveState(), and syten::MPS::DMRG::PDMRG::saveState().