2009-05-08 13:28:41 +00:00
|
|
|
#include <CStdFile.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2009-06-05 13:41:20 +00:00
|
|
|
* Copyright (c) 2007 Günther Brammer
|
2009-05-08 13:28:41 +00:00
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
char *pData; int iSize;
|
|
|
|
CStdFile MyFile;
|
|
|
|
if (argc < 2) {
|
|
|
|
fprintf(stderr, "%s infile [outfile]", argv[0]);
|
|
|
|
return 1;
|
|
|
|
}
|
2009-08-15 18:50:32 +00:00
|
|
|
MyFile.Load(argv[1], (BYTE **)&pData, &iSize, 0, true);
|
2009-05-08 13:28:41 +00:00
|
|
|
if (argc < 3) {
|
|
|
|
fwrite(pData, 1, iSize, stdout);
|
|
|
|
} else {
|
2009-08-15 18:50:32 +00:00
|
|
|
MyFile.Create(argv[2], false);
|
2009-05-08 13:28:41 +00:00
|
|
|
MyFile.Write(pData, iSize);
|
|
|
|
}
|
|
|
|
MyFile.Close();
|
|
|
|
}
|