comparison dis.c @ 4:8448e78efe82 default tip

Autmatic Win32 Porting
author VilyaemKenyaz
date Thu, 28 Sep 2023 13:20:56 -0400
parents a499c3c6b9ae
children
comparison
equal deleted inserted replaced
3:a499c3c6b9ae 4:8448e78efe82
1 //Displays a program, alternative to "cat", uses my based file library 1 /*********************************************
2 * Description - Display a file, dis
3 * Author - William King
4 * Date - Sep 25 2023
5 * *******************************************/
6
2 #include <stdio.h> 7 #include <stdio.h>
3 #include <stdlib.h> 8 #include <stdlib.h>
4 #include <string.h> 9 #include <string.h>
10
5 #include "basedfilelib.h" 11 #include "basedfilelib.h"
6 12
7 void main(int argc, char* argv[]){ 13 void main(int argc, char* argv[]){
8 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);} 14 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);}
9 //puts("Displaying:"); 15 //puts("Displaying:");
10 char * filetoread = argv[1]; 16 char * filetoread = argv[1];
11 char * file = ReadFile(filetoread); 17 char * file = ReadFile(filetoread);
12 //printf("Contents of argv: %s\n",*argv);
13 //printf("Reading file: %s\n",filetoread);
14 /*
15 while(strlen(file) != 0){
16 //char * print = ReadLine(file,1);
17 printf("%s\n",ReadLine(file,1));
18 DeleteLine(file,1);
19 }
20 */
21
22 printf("%s\n",file); 18 printf("%s\n",file);
23 exit(0); 19 exit(0);
24 } 20 }
25 21