Comments (5)
Problematically, the code does not complain when a file cannot be written and just continues running. This is likely undesirable behaviour in most cases.
from spirit.
I think it is OK for the code to continue in case of an error, but maybe an input variable to set the level when the code should stop (i.e. warning, error or severe) would be a good idea?
Also, we could add an ifdef
part which creates a folder using C++17, if available.
from spirit.
https://github.com/gulrak/filesystem could be used. It is absolutely sufficient for the use-cases of spirit and fortunately, it also works with emscripten 👍
If gulrak/filesystem should only be used when std::filesystem is not available, one can use the following code (though I would recommend against it because std::filesystem still requires some compiler flags depending on compiler versions, even in C++17 mode)
#if defined( __cplusplus ) && __cplusplus >= 201703L && defined( __has_include )
#if __has_include( <filesystem>)
#define GHC_USE_STD_FS
#include <filesystem>
namespace fs = std::filesystem;
#endif
#endif
#ifndef GHC_USE_STD_FS
#include <ghc/filesystem.hpp>
namespace fs = ghc::filesystem;
#endif
from spirit.
https://github.com/gulrak/filesystem is already being used by the IMGUI on the feature-imgui
branch. When the corresponding PR #583 is merged, it could be used by both ui-cpp
and core
(as is already done with fmt
.
from spirit.
Improved file reading and writing with commits d1fe9f8 and 18bf5d4, respectively. There's now both a FilterFileHandle
and OutFileHandle
, for which it would make sense to use fs::exists
, fs::is_directory
/fs::is_regular_file
, fs::create_directories
.
One could even use fs::is_empty
to detect when a file is being _over_written instead of just written.
Note that fs::current_path
gives the current working directory and that fs::weakly_canonical
can be used for paths that might not exist (it resolves the absolute path as far as possible and keeps the non-existent parts as well).
from spirit.
Related Issues (20)
- Spirit.exe crash "Qt5charts.dll not found" HOT 6
- Spin Torque GUI HOT 1
- Exporting documentation HOT 3
- Compilation Failed on Windows Desktop GUI HOT 3
- Error in loading the input.cfg file HOT 4
- Question on heisenberg_pairs HOT 1
- Query regarding Monte Carlo method HOT 3
- Problem in acceptance ratio HOT 2
- Query regarding the translation integers HOT 2
- Query regarding creation of skyrmion lattice HOT 2
- Queries Regarding SPIRIT Monte Carlo HOT 2
- Question on building layers
- Segmentation fault when disabling DDI during simulation HOT 6
- Calculating topological charge in for loop (Python API) HOT 2
- Simulating Skyrmions (Python API) HOT 2
- Question: Force convergence using the LLG method at finite temperature
- Compile error on ubuntu 22.04
- spins.ovf HOT 2
- The given config file could not be used! Please check the log for any details. The system has not been reset!
- How do you apply a localized magnetic field to a model? How to use CUDA to accelerate computing?
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 spirit.