> Hi,
> while using and browsing through latex2html v 98.1 release, I found the
> following (I'm on a Linux RedHat ix86 platform):
Thanks for spotting these Olaf.
Most are already known, and have been fixed for LaTeX2HTML v98.2 .
> 1) When I was specifying a $TMP dir, the first system("pnmcrop ...") of
> pstoimg did fail with weird 'EOF not found' messages (but only the
> first -- all others did succeed). Playing around with 'make_tmp_dir', I
> wondered what the effect of the lines
> open(STDOUT, ">${TMP}foo$$");
> print STDOUT &getcwd;
> close(STDOUT);
> open(FOO,"<${TMP}foo$$");
> $DESTDIR = <FOO>;
> close(FOO); unlink "${TMP}foo$$";
This is from pstoimg and was part of a test to check that
the $TMP directory was indeed both readable and writable.
(There is similar code in the latex2html script.)
However, rather than do this for every image, it is now
no longer done by pstoimg, but is checked once in the
main script, in a way which does *not* upset STDOUT .
> is, except for kind of "messing up" STDOUT. Replacing these lines
> simply by
> $DESTDIR = &getcwd;
> fixed my problem described above.
Later version of LaTeX2HTML do not have the problem.
> 2) W.r.t. those remaining l2h$$ directories (may be this is even
> connected to (1)?), i.e. w.r.t. cleaning up $TMPDIR: I have nowhere
> (in latex2html) found a line which attempts to unlink files in
> $TMPDIR, or which removes $TMPDIR. Adding the lines:
> # clean up $TMPDIR, as well
> if (opendir(DIR, "$TMPDIR")) {
> local(@files) = readdir(DIR);
> foreach (@files) { unlink "$TMPDIR$dd$_" }
> closedir (DIR);
> &write_warnings("\n\n Couldn't remove $TMPDIR : $!")
> unless (rmdir "$TMPDIR");
> }
> to the end of the 'cleanup' routine, solved the problem for me.
&cleanup does do this now too.
> 3) Inroutine open_dbm_database: Replace line
> dbmopen(%img_params, "${TMP}IMG_PARAMS",0755);
> by
> dbmopen(%img_params, "${TMP_}IMG_PARAMS",0755);
> otherwise IMG_PARAMS is in cwd, and never removed.
... and this is already fixed.
> 4) The 'cp' routine is not foolproof: If $src and $dest are the same
> files, then cp deletes content of $src. I suggest to add the
> following lines, befor $src and $dest are opened:
> local($sdev, $sino, $ddev, $dino);
> ($sdev, $sino) = stat($src);
> ($ddev, $dino) = stat($dest);
> return if ($sdev == $ddev && $sino == $dino);
> This should take care of it, as far as I can see -- don't know
> whether is cross-platform compatible, though.
OK, that is a good idea.
Is anyone aware of any platforms on which stat does *not*
return values for the 1st two fields ?
dev Device number of file-system
ino Inode number
Thanks again Olaf for running a comb through some of the code.
All the best,
Ross Moore