Georg Baum wrote:
> Richard Heck wrote:
>
>   
>> That's the approach I'm now taking, more or less, as Enrico found yet
>> further problems. He also suggested a simpler way, namely: note the time
>> when we start the conversion; then look at the modification times of the
>> files after the conversion to see which ones got generated. There could
>> be an issue if the converter runs really fast,
>>     
> I don't think so. Modification times are stored with a very fine precision
> (at least on ext3, but I don't believe that it is special here).
>   
How do I get at these highly precise times? The boost file_write_time()
function returns a time_t, which seems to be in seconds. (As you say,
this may not work anyway.)
>> so I'll probably end up 
>> also having to keep a simple list of what files were there in the first
>> place. In any event, the idea is then to have convert() return the list
>> of generated files as a vector<FileName> (thus implementing an earlier
>> suggestion of yours, though more generally), and the Exporter can do
>> with that list as it will. This is indeed simpler, since if we copy
>> everything to the new tempdir, then we still need to know what we put
>> there and what the converter put there, and of course it's possible the
>> converter will over-write some of the files we put there, which may then
>> need to be copied back to the tempdir for the next converter to use, so
>> we need to check the modification times anyway.
>>     
> That sounds very complicated. Do usetempdir converters really need to be
> supported in the middle of the conversion chain? AFAIK we are only talking
> about html converters here, and those occur only at the end, so it would be
> enough to simply copy the whole directory (and issue some warnign if such a
> converter is used elsewhere). That directory will for sure contain too many
> files, but it is impossible anyway to tell which generated files are needed
> wnd which are not needed, so it is IMHO no problem if some files like the
> aux files are in the directory that is finally copied.
>   
The only converters I know of that generate multiple files are the HTML
converters. But who knows what else people might want to use.

What you suggest may be the only workable solution. And if you just do
it all in the main temporary directory, then such converters will work
in the middle of the chain, as long as they don't mess with the wrong
files. As you say, copying all of that over will copy unneeded files,
but there's no easy way to tell which ones are needed, and people will
just have to sort that out for themselves.

So I'm thinking the right flag is something like "multifile", which
signals that the converter generates multiple files. The associated
behavior would then be copying the whole temporary directory over to a
subdirectory of the buffer's file directory. At least then we don't
litter /home/rgheck/files/ (or whatever) with garbage. (And then this
maybe could make 1.5.0.)

Seem reasonable?

Richard

-- 
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to