#include <iostream> // для оператора cout
#include <cstdio> // для функции rename
#include <sys/stat.h>
#include <fstream>
using namespace std;
int main()
{
mkdir ("/var/www/hls/live.m3u8", 0775);
ifstream infile;
ofstream outfile;
infile.open("/var/www/hls/55/live.m3u8");
outfile.open("/var/www/hls/live.m3u8");
char buffer[1000];
while(!infile.eof())
{
infile.getline(buffer,sizeof(buffer));
outfile<<buffer<<endl;
}
infile.close();
outfile.close();
return 0;
}
#include <iostream> // для оператора cout
#include <cstdio> // для функции rename
#include <sys/stat.h>
#include <fstream>
using namespace std;
int main()
{
mkdir ("/var/www/hls/live.m3u8", 0775);
ifstream infile;
ofstream outfile;
infile.open("/var/www/hls/55/live.m3u8");
outfile.open("/var/www/hls/live.m3u8");
char buffer[1000];
int c=0;
while(!infile.eof())
{
if(c>=4){
infile.getline(buffer,sizeof(buffer));
outfile<<buffer<<endl; }
else c++;
}
infile.close();
outfile.close();
return 0;
}
#include <iostream>
#include <fstream>
#include <cstdlib>
using std::cout;
using std::endl;
int main(int argc, char* argv[])
{
std::ifstream ifile;
std::ofstream ofile;
ifile.open("input", std::ios::in);
ofile.open("output", std::ios::out | std::ios::trunc);
int count = 0;
while(count != std::atoi(argv[1]))
{
if(ifile.get()=='\n')
count++;
}
ofile << ifile.rdbuf();
}