Sure (thanks for the tip, anyway), but you may know that Nagios allows plugins to be written in any language, not only C.<br><br>My point was just to warn plugin developers about concurrent plugin executions and colliding temp files, and suggesting a basic  way to circumvent this. Yours looks better than mine (and I googled for methods to do this in PERL, which is the language I use for plugin development, I'll consider updating my plugins), but this questions plugins portability and the need to install PERL libraries...<br>

<br>Anyway, thanks for your rude welcome to this mailing list. I just wanted to warn about a stupid bug I made lately where 2 concurrent executions of my plugin were using the same temp file. Leave the documentation as is, and expect no more comments from me.<br>

<br>Regards<br>Matthieu<br><br><div class="gmail_quote">On Wed, Dec 28, 2011 at 2:22 PM, Ferenc Wagner <span dir="ltr"><<a href="mailto:wferi@niif.hu">wferi@niif.hu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">Matthieu Fournet <<a href="mailto:fournet.matthieu@gmail.com">fournet.matthieu@gmail.com</a>> writes:<br>
<br>
> I'd like to add my 10 cents to the plugins developer guidelines (at section<br>
> "3.3. Don't make temp files unless absolutely required",<br>
> <a href="http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN254" target="_blank">http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN254</a>),<br>
> regarding the use of temporary files.<br>
</div>> [...]<br>
<div class="im">> So my advice would be to name temp files like :<br>
><br>
> tmp_[plugin_name]_[timestamp]<br>
<br>
</div>Libc provides the mkstemp() family and tmpfile() for this purpose.  I<br>
think you'd be better off using those instead of inventing own methods.<br>
--<br>
Regards,<br>
Feri.<br>
<br>
------------------------------------------------------------------------------<br>
Write once. Port to many.<br>
Get the SDK and tools to simplify cross-platform app development. Create<br>
new or port existing apps to sell to consumers worldwide. Explore the<br>
Intel AppUpSM program developer opportunity. <a href="http://appdeveloper.intel.com/join" target="_blank">appdeveloper.intel.com/join</a><br>
<a href="http://p.sf.net/sfu/intel-appdev" target="_blank">http://p.sf.net/sfu/intel-appdev</a><br>
_______________________________________________________<br>
Nagios Plugin Development Mailing List <a href="mailto:Nagiosplug-devel@lists.sourceforge.net">Nagiosplug-devel@lists.sourceforge.net</a><br>
Unsubscribe at <a href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel</a><br>
::: Please include plugins version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br>