Add options to only run INQUIRY and to scan the bus to scsidump (#1092) (#1261)

* Add options to only run INQUIRY and to scan the bus to scsidump
This commit is contained in:
Uwe Seimet
2023-10-30 11:34:07 +01:00
committed by GitHub
parent c78ba80088
commit 8f45e4f491
8 changed files with 325 additions and 176 deletions
+6 -10
View File
@@ -121,24 +121,20 @@ void CreateTempFileWithData(const string& filename, vector<uint8_t>& data)
fclose(fp);
}
// TODO Move this code, it is not shared
void DeleteTempFile(const string& filename)
{
path temp_file = test_data_temp_path;
temp_file += path(filename);
remove(temp_file);
}
void CleanUpAllTempFiles()
{
remove_all(test_data_temp_path);
path temp_file = test_data_temp_path;
temp_file += path(filename);
remove(temp_file);
}
string ReadTempFileToString(const string& filename)
{
const path temp_file = test_data_temp_path / path(filename);
ifstream in_fs(temp_file);
ifstream in(temp_file);
stringstream buffer;
buffer << in_fs.rdbuf();
buffer << in.rdbuf();
return buffer.str();
}