Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mirai_bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ namespace Cyan
string MiraiBot::ReadFile(const string& filename)
{
std::ifstream ifs(filename, std::ifstream::binary);
if (!ifs.is_open()) throw std::runtime_error("打开文件失败,请确认路径是否正确并检查文件是否存在");
std::filebuf* pbuf = ifs.rdbuf();
std::size_t size = pbuf->pubseekoff(0, ifs.end, ifs.in);
pbuf->pubseekpos(0, ifs.in);
Expand Down