#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char stringCom[70] = {"mpc add "};
char stringClear[10] = {"mpc clear"};
char *source, *disti;
char line[60];
char ch;
int count;
int test;
int main (void)
{
FILE *fp =
fopen("/boot/netrd.txt", "r");
if(fp == NULL)
{
perror("Unable to open file!");
exit(1);
}
system(stringClear);
for (count = 1; count < 10; count++)
{
source = line;
while((test = fgetc(fp)) != 13)
{
ch = test;
*source = ch;
source++;
}
if (count > 1)
line[0] = ' ';//Removes
lineshift
source = line;
disti = stringCom;//mpc add
disti =
disti + 8;
while
(*source != 0)
{
*disti = *source;
source++;
disti++;
}
*disti =
0;
system(stringCom);
}
fclose(fp);
return 0;
}
Compile med: g++ -o loader_f1 loader_f1.c
Bemærk:
dette er ekspermentel software der er ingen garanti for brugbarhed, det
kan derimod sandsynligvis være skadeligt, kun til brug i Danmark.