[texworks] external read-access causes TeXWorks to revert open file to old version

Paul A Norman paul.a.norman at gmail.com
Wed Oct 27 07:18:28 CEST 2010


Don't know what is being used  (where the trouble area might be), but
looks like there are flushing procedures available in Qt files
handling - don't know if this impinges on what has been happening or
not ...

 From ... http://doc.trolltech.com/4.7/qfile.html#flush

  "  bool QFile::flush ()
     Flushes any buffered data to the file. Returns true if successful;
     otherwise returns false.  "

Hope this helps someone,

Paul

On 27 October 2010 12:15, Paul A Norman <paul.a.norman at gmail.com> wrote:
> At least with QFileInfo caching is involved Qt 4.3 and up is this
> affecting it?...
>
> "To speed up performance, QFileInfo caches information about the file.
> Because files can be changed by other users or programs, or even by
> other parts of the same program, there is a function that refreshes
> the file information: refresh(). If you want to switch off a
> QFileInfo's caching and force it to access the file system every time
> you request information from it call setCaching(false)."
>
> http://doc.trolltech.com/4.3/qfileinfo.html
>
>
> On 27 October 2010 07:55, Stefan Müller <warrence.stm at gmx.de> wrote:
>> Hi again,
>>
>> today I had a lot of commits in my document. I used Scite the whole time
>> instead of TW without the described problem. I.e. no "positive run" with
>> Scite. So it really may be a TW issue. It could have still been a
>> coincidence, though...
>>
>> Best wishes and thanks for looking at this issue,
>> Stefan
>>
>> On 26.10.2010 11:31, Paul A Norman wrote:
>>>
>>> Thanks that clears a lot up Stefan.
>>>
>>> Unless the same thing happens using another text editor - it is
>>> outside of my experience area sorry.
>>>
>>> Paul
>>>
>>> On 26 October 2010 21:16, Stefan Müller<warrence.stm at gmx.de>  wrote:
>>>>
>>>> Hi Paul,
>>>>
>>>> On 26.10.2010 02:12, Paul A Norman wrote:
>>>>>
>>>>> Stefan,
>>>>>
>>>>> Just to clarify from your earlier postings, you said that you have two
>>>>> boxes, an Xp and a Linux box?
>>>>>
>>>>> 1. Was this happening under both Os-es please? I'm still thinking of
>>>>> caching issues here.
>>>>
>>>> It happens under both Os-es. I'm using v0.3 r606 on Windows and v0.3 r670
>>>> (with those extra debug lines from on of the previous mails) on Linux.
>>>>
>>>>> 2. And have you tried exactly the same procedures of what you call a
>>>>> "Positive run", not using TeXworks but instead a very simple text
>>>>> editor (preferably a GUI one).
>>>>
>>>> No, I haven't tried that. Mostly because I don't know any other nice TeX
>>>> editor for Linux. I could try to reproduce a "positive run" with Scite.
>>>> I'll
>>>> report back soon about this.
>>>>
>>>>> 3. Otherwise ... apparently there are two versions of TortoiseHG and
>>>>> one of them is a Qt version -can you determine which one you are on?
>>>>> ...
>>>>
>>>> In the TortoiseHG info is something written about "Python, PyGTK, GTK",
>>>> so I
>>>> suppose I'm not using the Qt version. I didn't know there was one.
>>>>
>>>> Stefan
>>>>
>>>>> Thoughts ...
>>>>>
>>>>> A. (i)(Starting to wonder if it is an intermittent Qt file handling
>>>>> issue - does Qt use any memory caching in opening and accessing and
>>>>> prior to commit to disk? Or build a virtual drive in Ram  for
>>>>> temporary staging (same thing practically I suppose)?
>>>>>     (ii) If so, is there an explicit flush/clear that needs to be
>>>>> called?
>>>>>     (iii) Is TortoiseHG Qt version accessing this same memory file
>>>>> caching area (wouldn't
>>>>>          that trigger some sort of a violation error message though or
>>>>> does Qt leave a door
>>>>>          open  for that between Qt applications?)?
>>>>>
>>>>> Paul
>>>>>
>>>>> On 26 October 2010 09:36, Stefan Müller<warrence.stm at gmx.de>    wrote:
>>>>>>
>>>>>> Another thing I just recognized: In a "positive run" (i.e. where the
>>>>>> problem
>>>>>> occurs) TW prints (beside others) the following debug messages:
>>>>>>
>>>>>> Loading: "/dir/to/my/file.tex"
>>>>>> Loading: "/dir/to/my"
>>>>>> ...
>>>>>> Loading: "/dir/to/my"
>>>>>> Changed: "/dir/to/my/file.tex"
>>>>>> Loading: "/dir/to/my/file.tex"
>>>>>>
>>>>>> Is it correct, that sometimes the directory and sometimes the file is
>>>>>> loaded?
>>>>>>
>>>>>> Stefan
>>>>>>
>>>>>>
>>>>>> On 25.10.2010 19:19, Stefan Müller wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> it has been a while since the last reply, but I was only now able to
>>>>>>> test again on my Linux machine with those debug messages you gave me
>>>>>>> (I
>>>>>>> didn't compile it for Windows).
>>>>>>>
>>>>>>> So, still strange things that happen. (Sometimes) When I change
>>>>>>> something in the open tex file in TW, save and commit this change with
>>>>>>> TortoiseHG (my Mercurial client), the debug messages say that the open
>>>>>>> tex file has changed and that the same file is loaded (again). Then TW
>>>>>>> displays an older version of the tex file. To get my current file back
>>>>>>> I
>>>>>>> have to reopen TW.
>>>>>>>
>>>>>>> So there are basically two possiblities I can think of.
>>>>>>> (1) TW has a problem with TortoiseHG accessing the tex file and
>>>>>>> "restores" an old version of the file. What goes wrong? Where does the
>>>>>>> old file come from?
>>>>>>> (2) TortoiseHG messes with the tex file causing TW to reload it. Why
>>>>>>> should TortoiseHG write on the file? And if TortoiseHG temporarily
>>>>>>> writes to the tex file, why doesn't TW reloads again when TortoiseHG
>>>>>>> restores the current (committed) version?
>>>>>>>
>>>>>>> Hopefully someone has an idea what's causing the problem or how it
>>>>>>> could
>>>>>>> be fixed, especially if it's (1). Thanks in advance.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Stefan
>>>>>>>
>>>>>>> On 22.09.2010 18:07, Stefan Löffler wrote:
>>>>>>>>
>>>>>>>> Am 2010-09-22 17:49, schrieb Stefan Müller:
>>>>>>>>>>
>>>>>>>>>> Anyway, if you build Tw yourself, you could add the following to
>>>>>>>>>> lines
>>>>>>>>>> (linenumber where to add in brackets) to get some debugging
>>>>>>>>>> information:
>>>>>>>>>> [959] qDebug()<<    "Loading:"<<    fileName;
>>>>>>>>>> [1094] qDebug()<<    "Changed:"<<    curFile;
>>>>>>>>>> This should print the filenames Tw loads, and whenever it detects a
>>>>>>>>>> change to the filename on the harddisk.
>>>>>>>>>
>>>>>>>>> Maybe that's not clever to ask, but in which file should I put those
>>>>>>>>> lines? I
>>>>>>>>> looked into TWApp.cpp, but it looks wrong there...
>>>>>>>>
>>>>>>>> Oops, sorry. In src/TeXDocument.cpp.
>>>>>>>>
>>>>>>>> Stefan
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>



More information about the texworks mailing list