File: use_random_unique_tmp_path

package info (click to toggle)
flightcrew 0.9.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 6,748 kB
  • sloc: cpp: 53,736; xml: 2,006; ansic: 275; python: 215; sh: 112; makefile: 8; exp: 8
file content (22 lines) | stat: -rw-r--r-- 812 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: use a random and unique temporary folder
Author: Thomas Pierson <contact@thomaspierson.fr>
Acked-By: Mattia Rizzolo <mattia@debian.org>
Bug-Debian: https://bugs.debian.org/861987
Forwarded: no
Last-Update: 2017-05-15

--- a/src/FlightCrew/Misc/TempFolder.cpp
+++ b/src/FlightCrew/Misc/TempFolder.cpp
@@ -63,10 +63,10 @@
     // that on Win because it points to the drive root there
     // instead of the system temp folder
     // http://www.delorie.com/gnu/docs/glibc/libc_295.html
-    fs::path main_temp_folder = fs::path( P_tmpdir );
+    fs::path main_temp_folder = fs::temp_directory_path();
 #endif    
 
-    return main_temp_folder / fs::path( FC_TEMP_FOLDER ) / fs::unique_path( UNIQUE_PATH_MODEL );
+    return main_temp_folder / fs::unique_path( UNIQUE_PATH_MODEL );
 }