Printing Utility

Mark Papadakis markp at palamida.math.uch.gr
Tue Aug 5 10:53:47 EEST 1997


On Tue, 5 Aug 1997, George Eleftheriou wrote:

> Costas wrote:
> 
> > Den me endiaferei ayto. Ayto poy thelo einai ena programma sto opoio tha
> > toy doso to input arxeio kai ayto tha arxisei na typonei selides (as
> > poyme prota tis mones) pidontas mia kathe fora. Me endiaferei poli o
> > aytomatismos. H lysi toy na toy po ego poies na tiposei (p.x 1,3,5, ktl)
> > einai asymfori logo toy ogkoy.
> To arxeio se ti format einai?
As grapsw kati se autin tin lista, me floodarete me mails(kai den mporw na
kanw unsubscribe 'coz your mailserver sux:), as sas floodarw kai egw
ligo..

(the following program hasn't been compiled, tested or whatever..i just
wrote it and it might work :)



#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define TOT_LINES 25	// i should have checked the console but.. :)\

int main( int argc, char *argv[] )
{
	int cur_page = 1;
	int d_page   = 1;	// print all pages
	FILE *handle;
	register char c;

	if(argc==1 || argc>3)
	{
		fprintf(stderr,"Bad syntax\n");
		return(1L);
	}
	if(!(handle=fopen(argv[1],"r)))
	{
		fprintf(stderr,"Cannot read \"%s\"\n", argv[1]);
		return(1L);
	}
	if(argc==3)
		d_page = atoi(argv[2]) >0 ? atoi(argv[2]) : 1;
	
	// lets rock..
	while(!feof(handle))
	{	
		c = fgetc(handle);
		if(cur_page % d_page==0)
			fprintf(handle,"%c", c);
		if(c==10 || c==13)
			cur_page++;
	}
	fclose(handle);
	return(0);
}

(chances are it won't work though :)
MarkP


	

	


=================================
           Mark Papadakis
       MindWorks Development
         markp at ics.forth.gr
http://palamida.math.uch.gr/markp
=================================


--
====================================================================
Gia na mathete pos na xrisimopoiite ton majordomo, stilte e-mail
sto "majordomo at argos.hol.gr" me 1 grammi sto keimeno: help
Ta archives tis listas einai sto http://www.argos.hol.gr/lists
Gia opoiodipote problima stilte  e-mail ston owner-linux-greek-users
====================================================================



More information about the Linux-greek-users mailing list