Added ability to write to file
This commit is contained in:
@@ -2,11 +2,10 @@
|
|||||||
Compiler: MinGW g++ 6.3.0 (Windows)
|
Compiler: MinGW g++ 6.3.0 (Windows)
|
||||||
MinGW g++ 5.3.1 (Ubuntu 16.04)
|
MinGW g++ 5.3.1 (Ubuntu 16.04)
|
||||||
Flags: -std=c++11 -static-libgcc -static-libstdc++ -lws2_32
|
Flags: -std=c++11 -static-libgcc -static-libstdc++ -lws2_32
|
||||||
Run ex: cardnet.exe -c1="G:\card0.txt" -c2="H:\card0.txt" -l1="G:\check.txt" -l2="H:\check.txt" -p="4500"
|
Run ex: cardnet.exe -p1="G:\card0.txt" -p2="H:\card0.txt" -c1="G:\check.txt" -c2="H:\check.txt" -p="4500"
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
Fix extra buffer character (maybe, it occurs in telnet)
|
Fix extra buffer character (maybe, it occurs in telnet)
|
||||||
Change card0.txt file based on information given by client (p1/p2)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -333,4 +332,17 @@ bool overwriteCard(std::string buffer, std::string location)
|
|||||||
|
|
||||||
// check if card exists
|
// check if card exists
|
||||||
debugOutput("Card data: " + card + "\n");
|
debugOutput("Card data: " + card + "\n");
|
||||||
|
|
||||||
|
// try to write card file
|
||||||
|
std::ofstream cardFile(location);
|
||||||
|
if(cardFile.is_open())
|
||||||
|
{
|
||||||
|
cardFile << card;
|
||||||
|
cardFile.close();
|
||||||
|
debugOutput("Successfully written card number to: " + location + "\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
debugOutput("Unable to write to card in: " + location + "\n");
|
||||||
|
}
|
||||||
}
|
}
|
Binary file not shown.
Reference in New Issue
Block a user