문제

A program I use is failing when it uses tmpfile() for large files. The problem seems to be I don't have permission to create large files in /tmp, which this function uses by default. So is there a way, perhaps with an environmental variable, that I can make tmpfile() write to a different location?

Edit: the program in question is sox, which uses C.

도움이 되었습니까?

해결책

You can use the environment variable TMPDIR to to tell tmpfile() where to create files:

sh syntax:

TMPDIR=/path/to/whatever; export TMPDIR

csh syntax:

setenv TMPDIR /path/to/whatever

다른 팁

Given the information in man tmpfile (3) you may want to: #define P_tmpdir "/somedir" Of course, this probably isn't too reliable.

You can also set your environmental variable, TMPDIR to some location.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top