view dis.c @ 3:a499c3c6b9ae

Are you STUPID???
author VilyaemKenyaz
date Tue, 29 Aug 2023 16:37:37 -0400
parents 2b6ce8d53356
children 8448e78efe82
line wrap: on
line source

//Displays a program, alternative to "cat", uses my based file library
#include <stdio.h> 
#include <stdlib.h>
#include <string.h>
#include "basedfilelib.h"

void main(int argc, char* argv[]){
	if (argc == 1 ) { puts("Dis by William King at Peep Soft\nDisplays a file to stdout, better than cat at this purpose\nUsage: dis (file)");exit(0);}
	//puts("Displaying:");
	char * filetoread = argv[1];
	char * file = ReadFile(filetoread);
	//printf("Contents of argv: %s\n",*argv);
	//printf("Reading file: %s\n",filetoread);
/*
	while(strlen(file) != 0){
		//char * print = ReadLine(file,1);
		printf("%s\n",ReadLine(file,1));
		DeleteLine(file,1);
	}
*/

	printf("%s\n",file);
	exit(0);
}