mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
use CFileHelpers::copyFile instead of own function; cleanup helpers
Origin commit data
------------------
Branch: ni/coolstream
Commit: 6d01d59b53
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-11 (Thu, 11 Aug 2016)
Origin message was:
------------------
- use CFileHelpers::copyFile instead of own function; cleanup helpers
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1110,44 +1110,7 @@ std::string Lang2ISO639_1(std::string& lang)
|
||||
}
|
||||
|
||||
//NI
|
||||
bool File_copy(std::string rstr, std::string wstr)
|
||||
{
|
||||
char * buffer;
|
||||
long size;
|
||||
|
||||
std::ifstream infile(rstr.c_str(), std::ifstream::binary);
|
||||
if (infile)
|
||||
{
|
||||
std::ofstream outfile(wstr.c_str(), std::ofstream::binary);
|
||||
if (outfile)
|
||||
{
|
||||
// get size of file
|
||||
infile.seekg(0,std::ifstream::end);
|
||||
size=infile.tellg();
|
||||
infile.seekg(0);
|
||||
|
||||
buffer = new char [size];
|
||||
infile.read (buffer,size);
|
||||
|
||||
outfile.write (buffer,size);
|
||||
|
||||
delete[] buffer;
|
||||
outfile.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
infile.close();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// rreturns the pid of the first process found in /proc
|
||||
// returns the pid of the first process found in /proc
|
||||
int getpidof(const char *process)
|
||||
{
|
||||
DIR *dp;
|
||||
|
Reference in New Issue
Block a user