Mercurial Hosting > dis
annotate dis.c @ 3:a499c3c6b9ae
Are you STUPID???
author | VilyaemKenyaz |
---|---|
date | Tue, 29 Aug 2023 16:37:37 -0400 |
parents | 2b6ce8d53356 |
children | 8448e78efe82 |
rev | line source |
---|---|
0 | 1 //Displays a program, alternative to "cat", uses my based file library |
1
b82f21466dfd
You can just printf the file what are you doing!
VilyaemKenyaz
parents:
0
diff
changeset
|
2 #include <stdio.h> |
b82f21466dfd
You can just printf the file what are you doing!
VilyaemKenyaz
parents:
0
diff
changeset
|
3 #include <stdlib.h> |
b82f21466dfd
You can just printf the file what are you doing!
VilyaemKenyaz
parents:
0
diff
changeset
|
4 #include <string.h> |
b82f21466dfd
You can just printf the file what are you doing!
VilyaemKenyaz
parents:
0
diff
changeset
|
5 #include "basedfilelib.h" |
0 | 6 |
1
b82f21466dfd
You can just printf the file what are you doing!
VilyaemKenyaz
parents:
0
diff
changeset
|
7 void main(int argc, char* argv[]){ |
2
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
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);} |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
9 //puts("Displaying:"); |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
10 char * filetoread = argv[1]; |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
11 char * file = ReadFile(filetoread); |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
12 //printf("Contents of argv: %s\n",*argv); |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
13 //printf("Reading file: %s\n",filetoread); |
3 | 14 /* |
2
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
15 while(strlen(file) != 0){ |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
16 //char * print = ReadLine(file,1); |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
17 printf("%s\n",ReadLine(file,1)); |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
18 DeleteLine(file,1); |
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
19 } |
3 | 20 */ |
21 | |
22 printf("%s\n",file); | |
2
2b6ce8d53356
Finished program, fully functional, seems to be faster than cat
VilyaemKenyaz
parents:
1
diff
changeset
|
23 exit(0); |
1
b82f21466dfd
You can just printf the file what are you doing!
VilyaemKenyaz
parents:
0
diff
changeset
|
24 } |
b82f21466dfd
You can just printf the file what are you doing!
VilyaemKenyaz
parents:
0
diff
changeset
|
25 |