|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 928 (0x3a0)
Types: TextFile
Names: »tmpfile.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/stat-5.3/eu/stat/src/tmpfile.c«
/* Copyright 1982 Gary Perlman */
/*LINTLIBRARY*/
#ifndef MSDOS
#ifndef lint
static char sccsfid[] = "@(#) tmpfile.c 5.0 (|stat) 11/10/85";
#endif lint
#endif MSDOS
int
tmpfile (pgm, filename)
char *pgm; /* name of the program */
char *filename; /* must be large enough to hold file name */
{
char *basename; /* will be the basename of pgm */
for (basename = pgm; *basename; basename++);
while (basename > pgm && *(basename-1) != '/')
basename--;
#ifdef MSDOS /* this will have to be changed for multitasking MSDOS */
strcpy (filename, basename);
strcat (filename, ".tmp");
#else
(void) sprintf (filename, "/tmp/%s%d", basename, getpid ());
(void) umask (0077);
#endif
return (0);
}
#ifdef TMPFILE
/*
$Compile: cc -DTMPFILE -o %F %f
*/
main (argc, argv)
char **argv;
{
char newfile[100];
while (--argc)
{
if (tmpfile (*++argv, newfile))
putchar ('\007');
puts (newfile);
}
}
#endif