1
/* ---------------------------------------------------------------------
2
* Custom file dialog vk_file_utils.cpp
3
* ---------------------------------------------------------------------
4
* This file is part of Valkyrie, a front-end for Valgrind
5
* Copyright (C) 2000-2008, OpenWorks LLP <info@open-works.co.uk>
6
* This program is released under the terms of the GNU GPL v.2
7
* See the file COPYING for the full license details.
10
#include "vk_file_utils.h"
15
/* ------------------------------------------------------------------ */
16
bool FileCopy(const QString& in, const QString& out)
18
const int bufSize = 16384; // 16Kb buffer
19
char *buf = new char[bufSize];
22
if( !fin.open(IO_ReadOnly) )
25
if( !fout.open(IO_WriteOnly) )
28
int len = fin.readBlock(buf, bufSize);
30
if (fout.writeBlock(buf, len) == -1)
32
len = fin.readBlock(buf, len);