Building a waiting list based on return code
本帖最後由 luckiejacky 於 2016-8-17 19:24 編輯
我想Build一個waiting list based on 那個module唔compile
然後based on 那個module改code...
改好後,用番原本個spec做regression testing
但nasm好似唔識return error code from "system"- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main(int argc, char* argv[])
- {
- ifstream specfile("spec.txt");
- ofstream waiting("waiting.txt");
- const std::string command = "nasm -f win32 ";
- std::string currCommand;
- std::string line;
- int code = 0;
-
- while (getline(specfile, line))
- {
- currCommand.append(command);
- currCommand.append(line.c_str());
- currCommand.append(" >> err.txt 2>&1");
- code = system(currCommand.c_str());
- if (code == -1)
- {
- waiting.write(line.c_str(), line.length());
- }
- currCommand.clear();
- }
- specfile.close();
- waiting.close();
- }
複製代碼 |
|
|