× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I think this answers most of what you asked.

<snip>
tmpnam() -- Produce Temporary File Name
Format
#include <stdio.h>
char *tmpnam(char *string);
Language Level: ANSI
Thread Safe: YES. However, using tmpnam(NULL) is NOT thread safe.
Description
The tmpnam() function produces a valid file name that is not the same as the name of any existing file. It stores this name in string. If string is NULL, the tmpnam() function leaves the result in an internal static buffer. Any subsequent calls destroy this value. If string is not NULL, it must point to an array of at least L_tmpnam bytes. The value of L_tmpnam is defined in <stdio.h>.

The tmpnam() function produces a different name each time it is called within an activation group up to at least TMP_MAX names. For ILE C, TMP_MAX is 32,767. This is a theoretical limit; the actual number of files that can be opened at the same time depends on the available space in the system.

Return Value

The tmpnam() function returns a pointer to the name. If it cannot create a unique name then it returns NULL.

Example that uses tmpnam()

This example calls tmpnam() to produce a valid file name.


#include <stdio.h>

int main(void)
{
   char *name1;
   if ((name1 = tmpnam(NULL)) !=NULL)
      printf("%s can be used as a file name.\n", name1);
   else printf("Cannot create a unique file name\n");

}

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c415607107.htm#IDX2619
</snip>



rob@xxxxxxxxx said the following on 3/21/2007 8:27 AM:
Ok, two people mentioned tmpnam(), and they're from different companies therefore it's probably not some custom code internal to that shop. Based on that:

1 - What is tmpnam()?  Where is some documentation?

2 - What I am doing is generating a temporary file in the IFS and then sending it off with SNDEMAIL. Would tmpnam() be applicable for that? Keeping in mind that SNDEMAIL isn't necessarily "instantaneous".


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.