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

Roussanka Loukanova rloukano at stp.lingfil.uu.se
Thu Mar 22 15:09:05 CET 2007


Hi,

Thanks, Bruno: I haven't yet realized the need of such modification, but 
your explanation gives (as always) better (and better) understanding of 
the workings of the TeX distributions.

I have a marginal comment about the editor, which might be useful, in 
particular, to people who use Carbon Emacs or Aquamacs (and would prefer 
to refrain from pico). The edditing access to files residing in the root 
directories is restricted within these editors.

OS X comes with its own Emacs. Unix Emacs lacks the graphical interface of
Carbon Emacs and Aquamacs, but is otherwise in entire powers. It can be 
invoked from the Terminal (in the same way as pico):

sudo emacs /usr/local/texlive/2007/texmf/web2c/texmf.cnf Ret

or for any file:

sudo emacs <path-file-name> Ret

OSX's emacs has the same key commands as Carbon Emacs and Aquamacs. For 
such small editing tasks in the root files, one would need very few 
commands:

Ctrl-x Ctrl-s   Save the changes in the file
Ctrl-x Ctrl-c   Quit Emacs

(As in Pico) You can also use the DownArrow key to move down line-by-line, 
and respectively, Left, Right and Up Arrows to move around until you get 
to the desired location in the file.

One can also search incrementally by using some key words, for ex., in 
this case: "open", "paranoid":

Ctrl-s (you'll be prompted to type in the bottom of the buffer, so type for 
ex. "paranoid" or "open" (without the quotes).

One can find information about emacs commands, for ex. at (there might be 
better places):

<http://www.utexas.edu/cc/docs/ccrl34.html>
<http://www.gnu.org/software/emacs/manual/emacs.html#Basic>

Roussanka

On Thu, 22 Mar 2007, Bruno Voisin wrote:

> 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 macostex-archives mailing list