Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 1992 > 9204
Article Listing 1

Listing 2: tmpname.c

/*
*  tmpname.c - Generate a temporary filename (in the TMP directory).
*  usage:
*      tmpname [<<prefix>>]
*  where <<prefix>> specifies the first few chars of the new name.
*  Sends the output to stdout.
*
* Compile
*     cc tmpname.c -o tmpname
*/

#include <<stdio.h>>
#define TMP "/tmp"

main(argc, argv)
int argc;
char **argv;
{
int i, j;
char prefix[20];

prefix[0] = '\0';
if (argc == 2)                  /* user user-supplied prefix,  */
strcpy(prefix,argv[1]);     /* if any */

puts(tempnam(TMP, prefix));     /* write output to stdout       */
}

/* End of File */




MarketPlace

NEW! Numara FootPrints 9 - Service Desk Management
IT Service Management that Delivers. Real Value. Real Flexibility. Real Results. Free Demo.

Online Crash Analysis
Automatically capture customer crash data, no debugger required. Support for .NET, C++, OS X, Java.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Visit Dell� Small and Medium Business Online Store
One Stop to Buy All Your Business IT Solutions. Browse Through Dell's Best Deals Online Now!

Wanna see your ad here?