mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-25 23:57:42 +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 <glob.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
#include <boost/system/error_code.hpp>
|
||||||
#include <boost/filesystem/convenience.hpp>
|
#include <boost/filesystem/convenience.hpp>
|
||||||
#include <boost/process.hpp>
|
#include <boost/process.hpp>
|
||||||
#endif
|
#endif
|
||||||
@ -187,8 +188,9 @@ namespace search_for_drives_internal
|
|||||||
//if not same file system - could be removable drive
|
//if not same file system - could be removable drive
|
||||||
if (! compare_filesystem_id(path, parent_path)) {
|
if (! compare_filesystem_id(path, parent_path)) {
|
||||||
//free space
|
//free space
|
||||||
boost::filesystem::space_info si = boost::filesystem::space(path);
|
boost::system::error_code ec;
|
||||||
if (si.available != 0) {
|
boost::filesystem::space_info si = boost::filesystem::space(path, ec);
|
||||||
|
if (!ec && si.available != 0) {
|
||||||
//user id
|
//user id
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
stat(path.c_str(), &buf);
|
stat(path.c_str(), &buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user