On Mar 13, 2000, Akim Demaille <[EMAIL PROTECTED]> wrote:
> BTW, I've long been looking for a portable to shorten the $$, such as
> using a-z too. Someone knows how do that?
Not easily, so I don't think it's worth it. You'd reduce it by at
most 1 or 2 characters.
Alexandre> A better solution would be to create a unique subdirectory
Alexandre> in /tmp in which we create the files to perform this test.
> But I seem to recall we once talked about this (creating a private tmp
> dir to work in) about texi2dvi, and you told me it was dangerous
> practice?
I recall the discussion. Indeed, creating anything in /tmp may be
dangerous, for the very reasons this thread started. Creating a
private tmp dir may help, but not if /tmp does not have the sticky bit
set.
> I'm all for testing in /tmp, it should speed up in most case, and
> dramatically simplify the various rm and traps in Autoconf.
One way to avoid the race conditions in this test would be to use
directories instead of files, i.e., mkdir instead of `echo > ...'. If
the second `mkdir' fails, it's very likely that the filesystem does
not support large filenames. But there are still possible race
conditions, unless we use the PID as part of the filename.
Alexandre> We should not accept a pre-existing directory, i.e., we
Alexandre> must attempt to create directories with different names
Alexandre> until mkdir succeeds.
> Gosh, I love this tortured way to do simple things. Just give them a
> couple a weeks, and the Debian guys will come up requiring that we use
> mktemp :)
Good idea :-) :-)
(indeed, this would be perfect way to deal with this problem, but
mktemp is not portable itself, so we'd always need a fallback)
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Enjoy Guaranį
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me