handles (ignores) errors when allocating files

This commit is contained in:
Arvid Norberg 2008-01-11 20:04:38 +00:00
parent c23539b272
commit 388949014f
1 changed files with 12 additions and 0 deletions

View File

@ -452,15 +452,27 @@ namespace libtorrent
// the directory exists.
if (file_iter->size == 0)
{
#ifndef BOOST_NO_EXCEPTIONS
try {
#endif
file(m_save_path / file_iter->path, file::out);
#ifndef BOOST_NO_EXCEPTIONS
} catch (std::exception&) {}
#endif
continue;
}
#ifndef BOOST_NO_EXCEPTIONS
try {
#endif
if (allocate_files)
{
m_files.open_file(this, m_save_path / file_iter->path, file::in | file::out)
->set_size(file_iter->size);
}
#ifndef BOOST_NO_EXCEPTIONS
} catch (std::exception&) {}
#endif
}
// close files that were opened in write mode
m_files.release(this);