mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Update io.cpp
This commit is contained in:
parent
5eaef2c900
commit
b4d5ebcfe5
@ -177,10 +177,7 @@ void add_module_os(VM* vm){
|
|||||||
try{
|
try{
|
||||||
di = std::filesystem::directory_iterator(path);
|
di = std::filesystem::directory_iterator(path);
|
||||||
}catch(std::filesystem::filesystem_error& e){
|
}catch(std::filesystem::filesystem_error& e){
|
||||||
std::string msg = e.what();
|
vm->IOError(Str(e.what()).lstrip());
|
||||||
auto pos = msg.find_last_of(":");
|
|
||||||
if(pos != std::string::npos) msg = msg.substr(pos + 1);
|
|
||||||
vm->IOError(Str(msg).lstrip());
|
|
||||||
}
|
}
|
||||||
List ret;
|
List ret;
|
||||||
for(auto& p: di) ret.push_back(VAR(p.path().filename().string()));
|
for(auto& p: di) ret.push_back(VAR(p.path().filename().string()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user