|
Hi Rob,
Ok, two people mentioned tmpnam(), and they're from different companies therefore it's probably not some custom code internal to that shop.
Did you really think I'd suggest code that's internal to my shop? (Unless, of course, I posted it)
> 1 - What is tmpnam()? Where is some documentation?Actually, there are two tmpnam() APIs, both provided by IBM and part of the ILE C/C++ runtime library and documented in the "ILE C/C++ Run-time Library Functions" manual in the Information Center.
There's a tmpnam() procedure for IFS filenames that comes up with a new, unique name that's in the root file system. Here's an example of that:
H BNDDIR('QC2LE') D tmpnam PR * extproc('_C_IFS_tmpnam') D string 39A options(*omit) d filename s 40A varying C eval filename = %str(tmpnam(*omit)) Then, there's a different one for traditional lib/objects: H BNDDIR('QC2LE') D tmpnam PR * extproc('tmpnam') D string 39A options(*omit) d filename s 40A varying /free filename = %str(tmpnam(*OMIT));Note that the IFS one has a different EXTPROC() from the non-IFS one. I suspect you want my first example (the IFS one).
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".
Yes, tmpnam() guarantees that there's no other file with the same name (at the time it's called) on your system. So it's ideally suited to stuff that needs the QtmmSendMail() API like SNDEMAIL.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.