a temporary folder or temporary directory is a directory used to hold temporary files. Many operating systems and some software automatically delete the contents of such directories at boot-up or at regular intervals.
Questions tagged [tempdir]
31 questions
121
votes
4 answers
When does System.getProperty("java.io.tmpdir") return "c:\temp"
Just curious as to when System.getProperty("java.io.tmpdir") returns "c:\temp". According to the java.io.File Java Docs-
The default temporary-file directory is specified by the system property java.io.tmpdir. On UNIX systems the default value of…

Ashish Pancholi
- 4,569
- 13
- 50
- 88
42
votes
6 answers
Change temporary directory
I am using R on windows and need to change the temporary directory where tmp files are stored.
I checked a few answers, here, in R-help, etc., but no one is working.
Some links I tried: here, here, and here.
After trying those answers (I have to…

Miguel Vazq
- 1,459
- 2
- 15
- 21
31
votes
8 answers
Making a temporary dir for unpacking a zipfile into
I have a script that checks a zipfile containing a number of matching PDF+textfiles. I want to unpack, or somehow read the textfiles from the zipfile, and just pick out some information from the textfile to see that the file version is correct.
I…

Arto Uusikangas
- 1,889
- 5
- 20
- 33
11
votes
2 answers
Deleting py.test tmpdir directory after successful test case
I'm running tests that create a lot of large files during execution. For this purpose I would like to delete the tmpdir directory if a test has passed. But if a test fails the contents of tmpdir should be left unchanged.
I know how to determine the…

Kanguros
- 1,902
- 2
- 12
- 18
9
votes
6 answers
Temporary directory persist across program runs
I need a temporary directory, but I want full control over its creation and deletion.
I will use this directory to place git repositories which I want to monitor for new commits, so I need to store them somewhere permanently.
Therefore I want to…

umpirsky
- 9,902
- 13
- 71
- 96
7
votes
1 answer
Junit cannot delete @TempDir with file created by Spark Structured Streaming
I created an integration test for my pipeline to check if the right CSV file is generated:
class CsvBatchSinkTest {
@RegisterExtension
static SparkExtension spark = new SparkExtension();
@TempDir
static Path directory;
//this…

Krzysztof Atłasik
- 21,985
- 6
- 54
- 76
7
votes
2 answers
Permission Denied When Writing File to Default Temp Directory
My program does some fairly intensive operations, so I use a scratch file in order to speed things up. I use the following Java code:
File scratchFile = new File(System.getProperty("java.io.tmpdir") + "WCCTempFile.tmp");
if (!scratchFile.exists())
…

Thunderforge
- 19,637
- 18
- 83
- 130
6
votes
1 answer
How to configure root for temp dirs in Java
We run code which does the standard for creating a temp directory:
import java.nio.file.Files;
And then:
tmp = Files.createTempDirectory("ourprefix-");
This, effectively, creates the directories under /tmp/ so that we get things like…

Alfe
- 56,346
- 20
- 107
- 159
6
votes
4 answers
Rscript running trouble with TMPDIR via plink -ssh on Windows
I want to create my own variant of makePSOCKcluster and newPSOCKnode using ssh connection via plink. So, I rewrite code
if (machine != "localhost") {
rshcmd <- getClusterOption("rshcmd", options)
user <- getClusterOption("user",…

Dmitriy
- 847
- 17
- 39
4
votes
1 answer
Files.createTempDirectory("") throws NullPointerException
When I call Files.createTempDirectory("") I get the below exception:
java.lang.NullPointerException
at sun.nio.fs.WindowsSecurityDescriptor.fromAttribute(WindowsSecurityDescriptor.java:353)
at…

balapal
- 41
- 1
- 6
4
votes
1 answer
How to solve java.security.AccessControlException?
I am trying to access client's temp directory through my applet on my web project.
When I run the applet by itself, it gets the tempdir with no problem.
When I try to get it on my project using javascript and calling the applet method, I am having…

Hamit Ocak
- 91
- 1
- 1
- 6
3
votes
0 answers
Download .rds from google drive using download.file()
I am still having trouble getting a large file (.rds) from google drive into R. The purpose is to pull the rds file from drive, for use in an Rshiny.app.
If I use
library(googledrive)
temp <- tempfile(fileext = ".rds")
dl <- drive_download(
…

Michael Caponegro
- 31
- 2
2
votes
1 answer
Change C# compile directory (Class Library & WPF; not ASP.NET)?
I'm running a Ramdisk in Windows 7. I've modified some web.config files to noticeably improve the compilation times of my ASP.NET solutions.
I've got a solution with about 40 WPF and Class Library projects, and it hasn't improved when I launch…

lance
- 16,092
- 19
- 77
- 136
2
votes
2 answers
How to use Junit 5's TempDir with Kotlin?
I want to convert the following (working) java test to Kotlin:
package my.project;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import java.io.File;
import…

peer
- 4,171
- 8
- 42
- 73
2
votes
3 answers
IIS 6+ASP.NET - many temp files generated
I have a ASP.NET + some .NET web-services running on IIS 6 (win 2003 server). The issue is that IIS is generating a lot (!) of files in "c:\WINDOWS\Temp" directory. a lot of files means thousands of files, which get to more than 3G of size so…

user123093
- 2,387
- 3
- 17
- 17