|
No, I've not seen anything that states the filename is based on timestamp, but it wouldn't surprise me if it is.
I've just looked at this link...
http://publib.boulder.ibm.com/infocenter/zvm/v6r1/index.jsp?topic=/com
.ibm.zvm.v610.edclv/tmpnam.htm
...but can't tell whether the filename should be unique across the LPAR.
"Produces a valid file name that is not the same as the name of any existing file..."
"The tmpnam() function produces a different name each time it is called within a module..."
"When the calling application is an OpenExtensions C program, tmpnam() returns a unique file name..."
...and don't know how to write something to test it !
We had some issues which I've investigated, and my conclusion is that tmpnam() has returned the same filename in two separate jobs.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Scott Klement
Sent: 14 October 2014 14:45
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: tmpnam() not unique
That would be very disappointing... IBM says that tmpnam() will generate a unique filename.
Does it say somewhere that this is based on the timestamp?? (which
certainly isn't unique!)
On 10/14/2014 8:19 AM, McGovern, Sean wrote:
I've believe I have encountered an issue with my use of tmpnam().
If 2 jobs use tmpnam() at the same timestamp moment, I *think* the same filename is returned (though I don't know how to test this scenario).
I haven't coded to handle this possibility, and end up with two jobs trying to create the same temporary IFS file.
I was thinking that a solution could be just prefix/suffix the job number to the filename returned by tmpnam().
Does that seem like a feasible solution ?
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.