Enrico Forestieri wrote:
With latest svn, LyX is not able to create the tmpdir:

$ lyx
../../../src/support/filetools.cpp(328): LyX could not create temporary 
directory in /tmp'

$ lyx -dbg files
Setting debug level to files
Debugging `files' (Files used by LyX)
../../../src/support/filetools.cpp(322): createTmpDir: tempdir=`/tmp'
createTmpDir:    mask=`lyx_tmpdir'
../../../src/support/FileName.cpp(375): Unable to create temporary file with 
following template: /lyx_tmpdir
../../../src/support/filetools.cpp(328): LyX could not create temporary 
directory in /tmp'

Abdel, I see that you recently touched that.

I'm not seeing any problem on Linux. But mine looks like this:

Debugging `files' (Files used by LyX)
filetools.cpp(322): createTmpDir: tempdir=`/tmp/'
createTmpDir: mask=`lyx_tmpdir'
FileName.cpp(371): Temporary file `/tmp/lyx_tmpdir.J21987' created.

Note the trailing slash: /tmp/. Also, the template is wrong. It should be: /tmp/lyx_tmpdir, not just /lyx_tmpdir.

The problem is here:

FileName FileName::tempName(FileName const & temp_dir, string const & mask)
{
QFileInfo tmp_fi(temp_dir.d->fi.absoluteDir(), toqstr(mask));
return FileName(createTempFile(tmp_fi.absoluteFilePath()));
}

tmp_fi.absoluteFilePath() is doing the wrong thing with "/tmp". It's giving us the path to where /tmp is---viz, /---not the path to /tmp itself, since the trailing slash is missing. Hence the /lyx_tmpdir, and the failure.

Replacing absoluteDir() there with absoluteFilePath() may do the trick.

rh


Reply via email to