How to Find the 'Temp' Directory in Linux

How to create a temporary directory?

Use mktemp -d. It creates a temporary directory with a random name and makes sure that file doesn't already exist. You need to remember to delete the directory after using it though.

How do I find imagemagick temp folder in linux?

The easiest way, is to look for any environment variables that you have set, e.g.:

  • MAGICK_TEMPORARY_PATH
  • MAGICK_TMPDIR

by running:

env | grep -i MAGICK

Else, if you haven't set any environment variable, do something that will force ImageMagick to use disk. So, for example:

convert -debug cache -limit memory 0 xc:black null:
2016-07-07T16:28:17+01:00 0:00.000 0.000u 6.9.5 Cache convert[55942]: cache.c/SetPixelCacheExtent/3737/Cache
extend black[0] (/var/tmp/magick-55942ZyrN1AO8SfVA[3], disk, 8B)
2016-07-07T16:28:17+01:00 0:00.000 0.000u 6.9.5 Cache convert[55942]: cache.c/OpenPixelCache/4020/Cache
open black[0] (/var/tmp/magick-55942ZyrN1AO8SfVA[-1], Map, 1x1 8B)
2016-07-07T16:28:17+01:00 0:00.010 0.000u 6.9.5 Cache convert[55942]: cache.c/DestroyPixelCache/1121/Cache
destroy black[0]

That shows you that my machine is using /var/tmp.

What happened to the TMP environment variable?

You are probably thinking of TMPDIR.

This variable shall represent a pathname of a directory made available for programs that need a place to create temporary files.

How can I change the temp folder where sqlite creates etilqs files on Ubuntu Linux R?

You can get R to use a different temporary directory, it respects several settings of environment variables:

edd@max:~$ Rscript -e 'print(tempdir())'              # default
[1] "/tmp/RtmpUdPCFL"
edd@max:~$ TMPDIR="." Rscript -e 'print(tempdir())' # overridden
[1] "./RtmpsJk2lP"
edd@max:~$

We will have to see with the sources of the RSQLite and/or sqldf packages to see if they use their own settings, or take it from R. If it is the latter, as I suspect for at least sqldf then you have a way.

But do remember to set TMPDIR (or alike) before you start R.



Related Topics



Leave a reply



Submit