rspec/rules/S5280/rule.adoc
2020-12-23 14:59:06 +01:00

17 lines
467 B
Plaintext

``mktemp``, ``mkstemp``, ``mkstemps`` or ``mkdtemp`` are useful functions to create temporary files and directories. They accept a ``template`` parameter which defines the path where the file should be created and which should contain at least six trailing "X"s to ensure the uniqueness of the filename.
== Noncompliant Code Example
----
mkstemp("/tmp/file_XXXX"); // Noncompliant
----
== Compliant Solution
----
mkstemp("/tmp/file_XXXXXX"); // Compliant
----