initial checkin from subversion

This commit is contained in:
Tretter
2017-02-07 20:03:49 +00:00
commit ed54469421
108 changed files with 1999 additions and 0 deletions

42
filecut.c Normal file
View File

@@ -0,0 +1,42 @@
#include <stdio.h>
#include <sys/stat.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
FILE * pq;
FILE * pz;
int ch;
unsigned long i;
struct stat statbuf;
unsigned long abzug;
if (argc != 4)
{
fprintf(stderr,"Aufruf:\n\n filecut <quelldatei> <zieldatei> <kürzungsfaktor(bytes)\n");
exit(2);
}
abzug = atoi(argv[3]);
pq = fopen (argv[1],"rb");
pz = fopen (argv[2],"wb");
if ((pq == NULL)||(pz == NULL))
{
fprintf (stderr,"\nKein Öffnen\n");
exit (4);
}
if (lstat(argv[1], &statbuf))
{
fprintf(stderr,"\nkann lstat nicht ausführen\n");
exit(3);
}
for (i=0;i<(statbuf.st_size - abzug);i++)
{
ch = fgetc(pq);
fputc(ch,pz);
}
fclose(pq);
fclose(pz);
return 0;
}