I want to call a dos command, such as "dir/B *.txt >>a.txt", how can I realize it in C or Fortran code?

Recommended Answers

All 3 Replies

system("dir/B *.txt >>a.txt");

Thank you very much, Is there a way in Fortran compile environment?

Whatever the Fortran equivalent of system() is. :) This is the C/C++ forum, not Fortran.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.