WvV> Now I noticed that binkd is writing 5 binary bytes to a try file. Seems
WvV> like some status information, plus the following string length.
Yes indeed binkd is using those files for some seemingly undocumented
purpose.
In a quick and dirty search, I found this in ftnq.c:
void write_try (FTN_ADDR *fa, unsigned *nok, unsigned *nbad, char *comment,
BINKD_CONFIG *config)
{
char buf[MAXPATHLEN + 1];
if (config->tries > 0)
{
ftnaddress_to_filename (buf, fa, config);
if (*buf)
{
FILE *f;
strnzcat (buf, ".try", sizeof (buf));
if ((f = fopen (buf, "wb")) != NULL)
{
fprintf (f, "%c%c%c%c%c%s",
*nok & 0xff, *nok >> 8,
*nbad & 0xff, *nbad >> 8,
(int) strlen (comment),
comment);
fclose (f);
}
}
}
}
void read_try (FTN_ADDR *fa, unsigned *nok, unsigned *nbad, BINKD_CONFIG
*config)
{
char buf[MAXPATHLEN + 1];
ftnaddress_to_filename (buf, fa, config);
if (*buf)
{
FILE *f;
unsigned char ch1, ch2, ch3, ch4;
strnzcat (buf, ".try", sizeof (buf));
if ((f = fopen (buf, "rb")) != NULL &&
fscanf (f, "%c%c%c%c", &ch1, &ch2, &ch3, &ch4) == 4)
{
*nok = ch1 + (ch2 << 8);
*nbad = ch3 + (ch4 << 8);
}
else
{
*nok = *nbad = 0;
}
if (f)
fclose (f);
}
}
I haven't found the time to further investigate e.g. the define for the
*.try file, but if I find anything I'll keep you posted.
--- Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.9.1.16) Gecko/20101125
* Origin: news://eljaco.se (2:203/2)
|