Github user achristianson commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/181
  
    @phrocker my thought is to definitely keep the RAII to have simpler/safer 
resource management. I see the unlink in the destructor. I would just tweak the 
naming & organization a bit. Now I see this is actually a unique *temporary* 
file session, so I would put that in the name. I wouldn't get rid of 
FileSystemUtils, but would create a nested class i.e. 
FileSystemUtils::TempFileManager. Usage like this:
    
    ```c++
    {
      FileSystemUtils::TempFileManager mgr;
      auto tmp_file = mgr.unique_file("/tmp", false);
      // Do something with tmp_file
    } // All tmp files created with mgr are cleaned up (RAII)
    ```


---

Reply via email to