Comments (11)
sys files seem to need being left apart when building the paths vector with directory_iterator (dialo-file.cpp line 256)
from irritator.
This works with the original sort function :
void copy_files_and_directories(const std::filesystem::path& current_path)
{
std::error_code err;
for (std::filesystem::directory_iterator it(current_path, err), et;
!err && it != et;
++it) {
std::string sit = it->path().string(); // Nedelec
if (sit.find(".sys") != -1) // Nedelec
continue; // Nedelec
if (it->is_directory(err) && !err) {
paths.emplace_back(*it);
continue;
}
if (it->is_regular_file(err) && !err) {
if (have_good_extension(*it) &&
have_good_file_name_starts(*it)) {
paths.emplace_back(*it);
continue;
}
}
}
}
from irritator.
I found another irritating file at home -) : DumpStack.log.tmp
New successful conditions are now :
if (sit.find(".sys") != -1 || sit.find("DumpStack") != -1) { // Nedelec
I can't find a generic test which could avoid calling is_directory on these special windows files
This discussion is related but does not conclude :
https://developercommunity.visualstudio.com/t/stdfilesystemis-directory-fails-with-exception-if/787098
from irritator.
I cannot reproduce the problem. I think a best solution is to use std::error_code
to avoid exception. Can you try the test
branch ?
from irritator.
I've succesfully generated the Test branch but the management of error codes doesn't raise an error anymore when ouput directory is selected on C:, dialog now shows a blank list of directories. I guess there is a real trouble with the status associated to these special files...
from irritator.
I have updated the test branch. Can you test?
FWI, I force the git push
, you can use git fetch origin && git reset --hard origin/test
to get the patch.
from irritator.
I use git functions integrated in Visual Studio, I think I got the right test branch I can see the last changes..._
I tested but file and dir list in dialog (output directory) remains empty. File and dir list in open file dialog contains directories but it is impossible to enter in any directory listed.
from irritator.
It works if && ec
or && ec1
, && ec2
are suppressed after is_directory(..., ec...)
-lines 286, 287, 293, 408, 426, 530, 545, 656-
I left it->is_directory(err) && !err
unchanged in copy_files_and_directories
I can see in https://developercommunity.visualstudio.com/t/stdfilesystemis-directory-fails-with-exception-if/787098 and in https://eel.is/c++draft/fs.op.is.directory#2 cited by the former link, that is_directory with ec as argument has noexcept statement whereas is_dierctory with single path doesn't have
bool filesystem::is_directory(file_status s) noexcept;
1Returns: s.type() == file_type::directory.
🔗
bool filesystem::is_directory(const path& p);
bool filesystem::is_directory(const path& p, error_code& ec) noexcept;
from irritator.
Ok. I think I already proposed this solution in #21 (comment)
I have updated the test branch with these changes. Can you test the test branch (again...) ?
from irritator.
It works now.
I did not understand in your solution cited above that introducing error_code as second parameter would fix so simply...
from irritator.
Cool. Thanks for the report. I merged the branches.
from irritator.
Related Issues (20)
- [negative]lif internal component -> no observation
- core: time-function model can be observed
- gui: missing hsm editor control
- abandon (core dumped)
- Allocator -> noexcept and never return nullptr
- Update containers to the new allocator
- Crash HOT 1
- crash: visualization does not work HOT 3
- Crash : can not import model into simulation tab. HOT 1
- Crash when setting parameter value HOT 1
- Crash with view setting
- component-list and observation layout problem
- refactor InputSmallString functions
- refactor is-compatible ports with constexpr
- Frequent death of application when clearing the simulation editor panel (Windows) HOT 2
- fix cmake warnings
- Add more behaviour to constant model.
- Split hierarchical state machine: model/simulation
- Observation of aggregated values HOT 1
- core: remove small_string from irt::observer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from irritator.