| iMatix home page | << | < | > | >> |
![]() Version 1.91 |
#include "(unknown)" static int uuencode ( char *strIn, char *strOut)
Uuendcode a file, with the output going to a new file. This function is used by smtp_send_mail.
{ char strLine[46]; int iCnt, iLineLen; FILE *fpin, *fpout; if (!(fpin = fopen (strIn, "rb"))) { return 1; } if (!(fpout = fopen (strOut, "wb"))) { return 1; } fprintf (fpout, "begin 666 %s\n", getfilename (strIn)); while (1) { iLineLen = fread (strLine, sizeof (char), 45, fpin); if (iLineLen <= 0) break; fputc (ENC (iLineLen), fpout); for (iCnt = 0; iCnt < iLineLen; iCnt += 3) { putgroup (&strLine[iCnt], fpout); } fputc ('\n', fpout); } fprintf (fpout, "end\n"); fclose (fpin); fclose (fpout); return 0; }
| << | < | > | >> |
![]() |