Category : OS/2 Files
Archive   : OS2TOOLS.ZIP
Filename : TEE.C

 
Output of file : TEE.C contained in archive : OS2TOOLS.ZIP
/*
HEADER: CUG000.00;
TITLE: Portable TEE;
DATE: 05/23/87;
DESCRIPTION: "Copies stdin to the specified file without changing
stdout.";
KEYWORDS: Software tools, Text filters,tee, pipes;
FILENAME: TEE.C;
WARNINGS: "The author claims copyrights and authorizes
non-commercial use only.";
AUTHORS: Michael M. Yokoyama;
COMPILERS: vanilla;
*/

#include

/*
* Portability Note: The AZTEC C compilers handle the binary/text file
* dichotomy differently from most other compilers. Uncomment the following
* #define if you are running AZTEC C:
*/

/*
#define putc(c,f) aputc(c,f)
*/

#ifndef TRUE
#define TRUE 1
#endif

#ifndef FALSE
#define FALSE 0
#endif

int main(argc, argv)
int argc;
char *argv[];
{
int cin, correct;
FILE *fout;

correct = FALSE;
if (argc == 2) {
if ((fout = fopen(argv[1], "w")) == NULL) {
fprintf(stderr,"TEE: cannot create %s\n", argv[1]);
return !0;
}
correct = TRUE;
}
else fprintf(stderr,"TEE Usage: tee out_file\n");

while ((cin = getchar()) != EOF) {
putchar(cin);
if (correct) putc(cin, fout);
}
if (correct) fclose(fout);
return !correct;
}


  3 Responses to “Category : OS/2 Files
Archive   : OS2TOOLS.ZIP
Filename : TEE.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/