#include <stdlib.h>
      #include <string.h>
      
      char *ss = "/tmp/fileXXXXXX";
      char *s = (char *)malloc(strlen(ss));
      strcpy(s, ss);
      puts(mktemp(s));
      free(s);
      

      C language logo
      Create tmp file

      Codiga's C Recipes

      Create a temporary file inside /tmp folder

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.