[OS X TeX] Error: I can't write on file '(name)'

Bruno Voisin bvoisin at mac.com
Thu Mar 22 08:52:51 EDT 2007


Le 22 mars 07 à 12:45, Jonathan Kew a écrit :

> Find the line
>
>     openout_any = p
>
> in there; change to
>
>     openout_any = r
>
> and I think you'll be OK. ("a" would be even more permissive than  
> "r", but I don't think you need that.)

Thanks for this tip, that's helpful. I knew about the -R option (=  
secure mode) of dvips, and about the -shell-escape and -no-shell- 
escape options of pdftex, but I didn't suspect there was this switch  
in addition for pdftex in texmf.cnf.

Regarding texmf.cnf, the gwTeX and MacTeX/TeXLive setups are a bit  
different. With MacTeX/TeXLive, there is one single texmf.cnf at:

/usr/local/texlive/2007/texmf/web2c/texmf.cnf

which is the file to edit. With gwTeX, there are two different  
texmf.cnf at:

/usr/local/gwTeX/texmf.cnf
/usr/local/gwTeX/texmf/web2c/texmf.cnf

The second file is the TeXLive default, and the first file is where  
local modifications are kept. The two are read in sequence, with any  
definition in the first superseding definitions read later in the  
second.

Hence, for MacTeX/TeXLive simply *edit* the unique /usr/local/texlive/ 
2007/texmf/web2c/texmf.cnf as said above, while for gwTeX you need to  
*add*:

     openout_any = r

to /usr/local/gwTeX/texmf.cnf.

Finally, to Alain, regarding the editor, in case you don't have  
TextWrangler you can simply use pico. pico is a stand-alone version  
of the text editor of the pine mail reader, and it's "intuitive"- 
enough to use (on second thought, I think pico in OS X points  
actually to nano, a GNU clone of pico -- those physicists, they just  
couldn't resist ;-).

Simply type in Terminal, using MacTeX as an example:

sudo pico /usr/local/texlive/2007/texmf/web2c/texmf.cnf

then use Ctrl-V to move down screen-by-screen until you reach the  
desired part (you can also use the DownArrow key to move down line-by- 
line):

% Allow TeX \openin, \openout, or \input on filenames starting with `.'
% (e.g., .rhosts) or outside the current tree (e.g., /etc/passwd)?
% a (any)        : any file can be opened.
% r (restricted) : disallow opening "dotfiles".
% p (paranoid)   : as 'r' and disallow going to parent directories, and
%                  restrict absolute paths to be under $TEXMFOUTPUT.
openout_any = p
openin_any = a

then modify the openout_any setting as required, and then type in  
Ctrl-O to save and Ctrl-X to quit.

The bad thing is that texmf.cnf will be overwritten each time TeX is  
updated, so that you'll have to redo your modification each time.  
Actually it's simpler with gwTeX, as installed by i-Installer: at  
each update, I think, i-Installer detects the local /usr/local/gwTeX/ 
texmf.cnf has been changed and offers to save a copy on your Desktop  
(with the date appended at the end of the name) before performing the  
update. Then you'll simply have to merge back your modifications  
after the update.

Hope this helps,

Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list