The traditional name of directories (especially on Unix and Unix-like operating systems) used to store temporary files. Also, the filename extension of temporary files.
Questions tagged [tmp]
317 questions
62
votes
3 answers
php:: how long to tmp files stay?
I am working on an upload script.
If a user uploads a file and it already exists I want to warn the user (this is all through ajax) and give them the option to replace it, or cancel.
Instead of moving the file,
I was curious if I could just leave…

Hailwood
- 89,623
- 107
- 270
- 423
45
votes
4 answers
Ruby how to write to Tempfile?
I am trying to create a Tempfile and write some text into it. But I get this strange behavior in console
t = Tempfile.new("test_temp") # => #
t << "Test data" # =>…

Siva
- 7,780
- 6
- 47
- 54
43
votes
3 answers
How do I clear my Rails file cache?
I’m running Rails 4.2.7 on Ubuntu 14.04. I have written the following method to help cache some data (preventing hits against my PostGres 9.5 database) …
class Country < ActiveRecord::Base
has_many :states
def self.cached_find_by_iso(iso)
…

Dave
- 15,639
- 133
- 442
- 830
42
votes
4 answers
Can't write to /tmp with php, despite 777 permissions and no open_basedir value
I'm trying to write a file to my /tmp directory (on an apache server) with the php fopen function, but it fails:

Anders Sundnes Løvlie
- 826
- 2
- 8
- 11
39
votes
8 answers
Changing the tmp folder of mysql
Our Mysql queries use temporary tables which creates temporary files in the process. Currently the files are written to /tmp. How exactly can the path of the temp folder to which mysql writes to be changed?

Maxim Dsouza
- 1,507
- 3
- 19
- 32
36
votes
6 answers
What happened to the TMP environment variable?
I always heard that the proper way to find the temporary folder on a UNIX machine was to look at the TMP environment variable. When writing code that worked on Windows as well as Linux, I would check for TEMP and TMP.
Today, I discovered that my…

boatcoder
- 17,525
- 18
- 114
- 178
29
votes
3 answers
Php has its own /tmp in /tmp/systemd-private-nABCDE/tmp when accessed through nginx
I found strange behaviour concerning php and /tmp folder. Php uses another folder when it works with /tmp. Php 5.6.7, nginx, php-fpm.
I execute the same script in two ways: via browser and via shell. But when it is launched via browser, file is not…

shukshin.ivan
- 11,075
- 4
- 53
- 69
24
votes
1 answer
Write to /tmp directory in aws lambda with python
Goal
I'm trying to write a zip file to the /tmp folder in a python aws lambda, so I can extract manipulate before zipping, and placing it in s3 bucket.
Problem
Os Errno30 Read Only FileSystem
This code was tested locally on my computer to make sure…

Codyj110
- 548
- 1
- 5
- 13
22
votes
4 answers
How can I save an image to my app's tmp dir?
Why is that if I use NSTemporaryDirectory to save my image, the image is saved into
/var/folders/oG/oGrLHcAUEQubd3CBTs-1zU+++TI/-Tmp-/
and not into
/Users/MyMac/Library/Application Support/iPhone…

vosy
- 231
- 1
- 4
- 7
18
votes
2 answers
Heroku - how to write into "tmp" directory?
I need to use the tmp folder on Heroku (Cedar) for writing some temporarily data, I am trying to do that this way:
open("#{Rails.root}/tmp/#{result['filename']}", 'wb') do |file|
file.write open(image_url).read
end
But this produce error…

user984621
- 46,344
- 73
- 224
- 412
17
votes
1 answer
Store file in directory tmp on heroku Rails
In my Delayed Job, I tried to create a file to tmp folder
file_path = Rails.root.join('tmp', "#{file_name}." + file_extension);
exported_file = kit.to_pdf
# Save file to disk
File.open(file_path, 'wb') do |file|
file << exported_file
end
It…

ZeroX
- 195
- 1
- 2
- 7
16
votes
5 answers
Unable to create tempDir, java.io.tmpdir is set to C:\Windows\
I'm using Spring Boot with embedded tomcat, everything worked fine and suddenly I got the error :
Caused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to create tempDir. java.io.tmpdir is set to C:\Windows\
…

ilya
- 182
- 1
- 2
- 9
15
votes
3 answers
Ruby: Could not find a temporary directory
I am getting some 500 errors in my Passenger Rails app. When looking at the log it appears passenger cannot access the /tmp dir. I have validated that it is there and has RW access to root, and then tried www-data. What is going on here?
…

Clayton Selby
- 1,225
- 1
- 11
- 26
14
votes
1 answer
How to use Node tmp Package to write a file from the buffer
I need to write a file temporarily to the file system in order to run a quick check on it, and I then want it deleted.
Based on my Googling, it looks like the tmp package for NodeJS can be used:
https://www.npmjs.com/package/tmp
But I'm really…

Doug
- 6,446
- 9
- 74
- 107
14
votes
2 answers
tmp folder in Windows like /tmp in Linux
I have created a folder in Windows, C:\tmp\ and I want it to behave like /tmp/ folder in Linux, i.e. its contents are removed every time the system is booted.
I think the commands to run could be (at least on windows 7):
RD C:\tmp /S /Q
MKDIR…

Diego Herranz
- 2,857
- 2
- 19
- 34