home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hot Shareware 32
/
hot34.iso
/
ficheros
/
NINET
/
ALML303D.ZIP
/
EXAMPLES
/
DUMPMAIL.C
next >
Wrap
C/C++ Source or Header
|
1996-06-18
|
772b
|
41 lines
/* Program: DUMPMAIL */
/* Author: Brian Dorricott */
/* Date: 11th January 1996 */
/* Copyright: (C)opyright 1996, Internet Shopper Ltd */
#include <stdio.h>
#include <winsock.h>
#include <windows.h>
#define MAX_LINE 16384
main(int argc, char *argv[])
{
FILE *f;
char line[MAX_LINE];
int done = FALSE;
if (argc == 2)
{
f = fopen(argv[1], "w");
while (!done)
{
fgets(line, MAX_LINE, stdin);
while (*(line+strlen(line)-1) == '\r' || *(line+strlen(line)-1) == '\n')
*(line+strlen(line)-1) = '\0';
if (strcmp(line, ".") == 0)
done = TRUE;
if (f != NULL && !done)
fprintf(f, "%s\n", line);
}
if (f != NULL)
fclose(f);
}
return 0;
}