Mail Archives: djgpp-workers/1999/03/23/09:08:18
Eli Zaretskii <eliz AT gnu DOT org> writes:
> Emacs doesn't use temporary-file-directory for temporary files used to
> redirect the standard streams of sub-processes. So the files.el code
> is not relevant to this particular problem.
call-process-region uses the value of temp-file-name-pattern as a
pattern for making temporary files. This variable is set from $TMPDIR
or points to /tmp.
>
> for ms-dos and windows. The only reason I can imagine is faster
> startup (TEMP is more likely to be defined in ms-dos), but it is
> somewhat ridiculous.
>
> Why ridiculous? The NT port is maintained by other people, and
> different people have different considerations on what's right and
> what's wrong.
It was just my IMHO, I did not mean to say that maintainers of NTEmacs
don't know what they are doing. BTW, I'm using NTEmacs more than
DJGPP Emacs, but only because of nicer fonts and colors, obviously
DJGPP Emacs works better with the rest of DJGPP.
>
> Note that in 20.3, TMPDIR will also be used, since msdos.c defines it
> at startup. So it's a moot point anyway.
I have a story about call-process-region and TMPDIR. I'm using
Emacs-19.34 on Unix and have written some functions to obtain notice
board messages from Novell server by ftp in order to read them with
Gnus. Because NB is closed for anonymous ftp access I have to use my
own account on that server and pass my user name and password to ftp
program. I prepare ftp commands in a buffer and run ftp with
call-process-region and then parse the output of ftp. It all works
nicely, but then I noticed that Emacs creates temporary files in /tmp
directory with contents of that buffer and my password. I tried to
point TMPDIR to another directory closed for world and group access,
but temporary files are still created in /tmp by call-process-region.
Now I write ftp commands into temporary file and run call-process on
it. If all temporary files were created in TMPDIR, TEMP, TMP or /tmp
then it would work as expected, and users (in this case me) will not
need to look in the sources to understand exact Emacs's behaviour.
P.S. All of this is just IMHO, and because I don't know all the
details about Emacs internals (e.g. what is required for dumping) I
can only tell that handling of temporary files does not look right.
--
Michael Bukin
--
Michael Bukin
- Raw text -