mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 07:37:37 +08:00
error_code in boost::filesystem::space to ensure the drive exists. Fix of #5354
This commit is contained in:
parent
b9c53adddb
commit
ae926bd1ed
@ -20,6 +20,7 @@
|
||||
#include <glob.h>
|
||||
#include <pwd.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#include <boost/process.hpp>
|
||||
#endif
|
||||
@ -187,8 +188,9 @@ namespace search_for_drives_internal
|
||||
//if not same file system - could be removable drive
|
||||
if (! compare_filesystem_id(path, parent_path)) {
|
||||
//free space
|
||||
boost::filesystem::space_info si = boost::filesystem::space(path);
|
||||
if (si.available != 0) {
|
||||
boost::system::error_code ec;
|
||||
boost::filesystem::space_info si = boost::filesystem::space(path, ec);
|
||||
if (!ec && si.available != 0) {
|
||||
//user id
|
||||
struct stat buf;
|
||||
stat(path.c_str(), &buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user