if (ulprotocol == 4) { /* Text */
FileIO *fio;
char inputline[256];
printf("Send your text now, enter CTRL-D or a single period to complete upload\n");
fio = FIOopenUFS(filename, O_WRONLY|O_CREAT, 0600);
if (fio == NULL) {
printf("Couldn't open the file %s for writing\n", filename);
CURenter();
return;
}
while(gets(inputline)) {
ZapCRLF(inputline);
if (strcmp(inputline, ".") == 0)
break;
FIOwritestring(fio, inputline);
}
FIOclose(fio);
} else {
printf("Executing the following command\n%s\n",cmdline);
if (FIOsystem(cmdline))
printf("Upload failed, sorry...\n");
}
end = time(NULL);
if (stat(filename, &buf) < 0)
printf("Upload failed, try again...\n");
else {
printf(Gtxt("Upload complete. %d total bytes, %d bytes/sec\n",182),
(int)buf.st_size, ((int)buf.st_size)/(end-start));
}
printf(Gtxt("Press <RETURN> to continue",121));