Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. #include "stdafx.h"
- 2. #include <iostream>
- 3. #include <fstream>
- 4. #include "process.h"
- 5. #include <stdio.h>
- 6. #include <stdlib.h>
- 7. #define BUFFERSIZE
- 8. using namespace std;
- 9. int main (int argc, char **argv) {
- 10. unsigned char buffer[BUFFERSIZE];
- 11. int bytes_read=0;
- 12. int buffer_size=0;
- 13. FILE * myfile;
- 14. myfile = fopen ("/wamp/sendmail/output.txt","w");
- 15. buffer_size=sizeof(unsigned char)*BUFFERSIZE;
- /* open stdin for reading */
- 16. while((bytes_read=fread(&buffer, buffer_size, 1, stdin))==buffer_size){
- 17. fprintf(myfile, "%c", buffer[0]);
- 18. }
- //close output file
- 19. fclose(myfile);
- 20. system("/wamp/sendmail/save.bat");
- 21. return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment