×
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've encountered the condition where two timestamps are created with the same value.
My "fix" was to attempt to write the TS value to a uniquely keyed file and if a duplicate
key error resulted, the time stamp value would be incremented by a small fraction and
the write retried until a unique value was created . . .
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of McGovern, Sean
Sent: Tuesday, October 14, 2014 7:20 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: tmpnam() not unique
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.