Skip to content

Conversation

@A-006
Copy link
Collaborator

@A-006 A-006 commented Jan 4, 2026

This PR replaces usages of std::system for file system operations (like creating directories, checking file existence, and copying files) with C++ standard library functions or POSIX system calls (mkdir, stat, rmdir, std::ifstream/std::ofstream). This improves portability and removes the dependency on a shell environment.

Changes:

  • Replaced system("mkdir ...") with mkdir() in Global_File::make_dir_out, GlobalFunc::MAKE_DIR, and Exx_Lip::write_q_pack.
  • Replaced system("test -d ...") with stat() in ReadInput::create_directory and GlobalFunc::MAKE_DIR.
  • Replaced system("cp ...") with std::ifstream/std::ofstream in Exx_Lip::write_q_pack.
  • Updated unit tests in global_function_test.cpp to use stat and rmdir instead of system.
  • Fixed a template instantiation syntax error in
    ctrl_runner_lcao.cpp

@A-006 A-006 marked this pull request as draft January 4, 2026 13:17
@A-006 A-006 marked this pull request as ready for review January 6, 2026 04:15
@mohanchen mohanchen added Refactor Refactor ABACUS codes Features Needed The features are indeed needed, and developers should have sophisticated knowledge GPU & DCU & HPC GPU and DCU and HPC related any issues labels Jan 7, 2026
@mohanchen mohanchen merged commit 24ff385 into deepmodeling:develop Jan 7, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge GPU & DCU & HPC GPU and DCU and HPC related any issues Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants