Reorganizing some files.

This commit is contained in:
2015-02-08 23:37:56 +04:00
parent 7a53e5a3a1
commit 12af9d1b7f
22 changed files with 0 additions and 270 deletions

40
util/mergeTwoFiles.cpp Normal file
View File

@@ -0,0 +1,40 @@
// mergeTwoFiles.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
FILE* f1 = fopen( "D:\\tmp\\pf.avi", "rb" );
FILE* f2 = fopen( "D:\\tmp\\PulpFiction2.avi", "rb" );
FILE* o = fopen( "D:\\tmp\\aaaa.avi", "wb" );
char buf[2048];
for ( ; !feof( f1 ); )
{
int n = fread( buf, 1, sizeof( buf ), f1 );
if ( !n )
break;
bool b = false;
for ( int i = 0; !b && i < n; ++i )
if ( buf[i] )
b = true;
if ( !b )
{
int pos = ftell( f1 );
fseek( f2, pos, SEEK_SET );
n = fread( buf, 1, sizeof( buf ), f2 );
}
fwrite( buf, 1, n, o );
}
fclose( o );
fclose( f1 );
fclose( f2 );
return 0;
}