Lines Matching defs:template
36 char *template = *toys.optargs, *dir, *te = getenv("TMPDIR");
45 // if template, no prefix unless -pt. if !template, always prefix
48 if (!template) template = "tmp.XXXXXXXXXX";
50 if (*template == '/' && TT.p && *TT.p) perror_exit("-p + /template");
55 template = dir ? xmprintf("%s/%s", dir, template) : xstrdup(template);
56 len = strlen(template);
57 if (len<3 || strcmp(template+len-3, "XXX")) perror_exit("need XXX");
59 // In theory you just xputs(mktemp(template)) for -u, in practice there's
63 char *s = template+len;
70 rr = ts.tv_nsec*65537+(long)template+getpid()+(long)&template;
73 while (--s>template) {
81 } else if (FLAG(d) ? !mkdtemp(template) : mkstemp(template) == -1) {
86 FLAG(d) ? "directory" : "file", template);
89 xputs(template);
90 if (CFG_TOYBOX_FREE) free(template);