[Nagiosplug-devel] tip for plugin development and temp files

Ferenc Wagner wferi at niif.hu
Wed Dec 28 14:22:01 CET 2011


Matthieu Fournet <fournet.matthieu at gmail.com> writes:

> I'd like to add my 10 cents to the plugins developer guidelines (at section
> "3.3. Don't make temp files unless absolutely required",
> http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN254),
> regarding the use of temporary files.
> [...]
> So my advice would be to name temp files like :
>
> tmp_[plugin_name]_[timestamp]

Libc provides the mkstemp() family and tmpfile() for this purpose.  I
think you'd be better off using those instead of inventing own methods.
-- 
Regards,
Feri.




More information about the Devel mailing list