Le 8 juin 07 à 10:28, Mael Hilléreau a écrit :
What is the status of this patch?
What do you mean by "status" exactly? I don't know if it was tested
by others than me. But to be integrated, it is clear that the code
needs more testing, and then some #ifdefs in order to be applied
only to Mac OS.
Well, of course, we need to find a consensus on how updates should be
done... At the end, will we use a timestamp alone or in conjunction
with CRC?
IMHO, the timestamp is sufficient and I didn't encounter
inconsistencies while using the existing patch (in which the CRC
isn't used for directories).
In contrast, you (Andre and Jean-Marc) think a Timestap+CRC would be
better. Andre said that some problems could arise when saving a file
more than one time within a second. For my part, I think that this
situation won't arise when dealing with external graphics. Perhaps
you had a more general point of view and thought about other
conversions such as in math previews, or anything else... But as I'm
new to LyX sources, I don't know much about how the preview mechanism
is led.
I think we really need to clarify how an update should be triggered.
We could start by describing the problem as follows:
* Approach: Timestamp (i), Timestamp+CRC (ii)
* Contents changed? Yes (1), no (2)
* Timestamp changed? Yes (a), no (b)
All possible situations are:
* 1a: this case leads to an update in (i) and (ii). If we use (i) the
test is cheaper;
* 1b: this situation is inconsistent: the editor updated the contents
but not the timestamp of the directory, or it updated the timestamp
but didn't change it (less than 1 sec interval). If we use (i) this
situation cannot be detected whereas it can if we use (ii);
* 2a: this situation is inconsistent: the user updated the file
without changing its contents. It cannot be reached if situation 1b
can (excluding the 1 sec problem), and conversely. If we use (ii) the
test is cheaper assuming that the conversion process is more
expensive than the CRC;
* 2b: no modification is made in both (i) and (ii). If we use (i),
the test is cheaper.
Recall: IMO 1a and 2b are the most frequently, 2a is rare and 1b
never occurs when dealing with external graphics. That's why I would
pitch on approach (i).
The questions are mainly: should we consider that situation 1b can
arise or not? And is it worthwhile to save time in 2a if we loose
time in 1a and 2b? Could anyone give us more information/suggestions/
point of views about this?
Finally, what kind of #ifdef should be used: Should we select Mac OS
only, or should we create some variable for OSes providing graphics
as directories (e.g. #ifdef HAVE_GRAPHICS_DIR)?
Mael.