10 fprint(2, "usage: write [-z] [-h host] [-t type] <datablock\n");
11 threadexitsall("usage");
15 threadmain(int argc, char *argv[])
19 uchar *p, score[VtScoreSize];
22 fmtinstall('F', vtfcallfmt);
23 fmtinstall('V', vtscorefmt);
33 host = EARGF(usage());
36 type = atoi(EARGF(usage()));
46 p = vtmallocz(VtMaxLumpSize+1);
47 n = readn(0, p, VtMaxLumpSize+1);
49 sysfatal("input too big: max block size is %d", VtMaxLumpSize);
52 sysfatal("could not connect to server: %r");
54 sysfatal("vtconnect: %r");
56 n = vtzerotruncate(type, p, n);
57 if(vtwrite(z, score, type, p, n) < 0)
58 sysfatal("vtwrite: %r");