See http://bugzilla.lyx.org/show_bug.cgi?id=605, http://bugzilla.lyx.org/show_bug.cgi?id=1231 and http://bugzilla.lyx.org/show_bug.cgi?id=1244 for details of these bugs.
With help from discussion on this list and using Jean-Marcs old patch for bug 605 I believe I have fixed bugs 605, 1231, and 1244. What I did was: 1. Remove the choice of having a tmp dir, use it always 2. Rework insetgraphics, insetinclude and insetexternal to - output all generated files in the master buffer's tmp dir - output relative filenames in latex if latex is run and some minor supporting stuff. I would like to get this in in two steps, but first the following problems need to be solved: I currently have in Buffer::Impl::Impl() after creating the tmp dir: temppath = CreateBufferTmpDir(); if (temppath.empty()) { Alert::error(_("Could not create a temporary directory"), bformat(_("Could not create a temporary directory in\n" "%1$s. Make sure that this\n" "path exists and is writable " "and try again."), os::getTmpDir())); // Don't load the document if we have no temp dir. // FIXME: Does this work? filename.erase(); filepath.erase(); } I want to guarantee that temppath() is valid (this check is currently done in some places where it is used, but in other places it is assumed that it is valid). However, I am not sure wether the above works. Has anybody a better idea? Similar in LyX::init(): os::setTmpDir(CreateLyXTmpDir(lyxrc.tempdir_path)); if (os::getTmpDir().empty()) { //FIXME: Better error message, don't exit but make sure that //no files can be loaded. Alert::error(_("Could not create temporary directory"), bformat(_("Could not create a temporary directory in\n" "%1$s. Make sure that this\n" "path exists and is writable and try again."), lyxrc.tempdir_path)); exit(1); } This is certainly too brutal. How can I make sure that no files can be loaded, but for example the temp path setting can be corrected? Georg