Re: tip for plugin development and temp files
Ferenc Wagner <[email protected]>
| Newsgroups | gmane.network.nagios.plugins.devel |
|---|---|
| Message-ID | <[email protected]> |
Matthieu Fournet <[email protected]> writes: > On Wed, Dec 28, 2011 at 2:22 PM, Ferenc Wagner <[email protected]> wrote: > >> Matthieu Fournet <[email protected]> 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. > > [...] > 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. Sorry, I didn't mean being rude or hurting you in any way. I had to be terse, but if my language was strong, that must be because English isn't my first language. I sincerely apologise. Back to the technical part: as I understand it, we are in full agreement and I've got nothing against inserting a warning into the guide. -- Regards, Feri. ------------------------------------------------------------------------------ Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox _______________________________________________________ Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel ::: Please include plugins version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null