I recently updated to version 2.11.2 on Windows 10. I have latex files on Dropbox that I notice are now unable to save, instead Texstudio creates a new file with a random Letter followed by a number string prefixed to the file name (See image below).
I have downgraded to version 2.11.0 (portable) to test if this was Dropbox or TeXstudio. Version 2.11.0 had no problems saving to my Dropbox folder and did not create any new files.
I notice that this appears in the Changelog:
Is anyone else able to replicate this? I am using a feature of ShareLatex to sync latex projects with my dropbox.
I will be downgrading until this problem can be addressed.
Bugs: #1947
Bugs: #1964
Bugs: #1971
Bugs: #1982
Bugs: #2095
Discussion: Copies of tex file with weird extensions keep being created
An update: The portable version is able to save, but version 2.11.0 installed version is not.
This feels like it might be a permissions thing.
Questions:
Overwriting a file on disk has an inherent risk of loosing data if something goes wrong. The correct approach is: Write a temporary file. If that succeeds remove the original file and rename the temporary file. Before 2.11.0 we used our own proprietary implementation for this. From 2.11.0 on, we switched to a standard Qt mechanism using QSaveFile.
In 2.11.0 there was no warning because that was not implemented. In 2.11.2 there should be. We'll have to investigate why it's not the case.
I do not understand that. The portable version is binary identical to the installed version. Please check in the about dialog if the version (including hg revision) and the used Qt versions are the same.
Dropbox interacts with the file system for synchonisation. It might be that this interferes with the accessibility of files or the above mentioned method of saving files. That needs to be tested. However, I don't have Dropbox installed right now, so it will take some time before I can look into this.
Update: the portable version does have the problem, but it seems that sometimes the problem does not show up. This occured when I first tested the portable code, but after shutting down my computer the problem showed itself in the portable self.
I am downgrading to TeXstudio 2.10.8 (hg 5804:967c6023de2d) until the problem is fixed.
You might want to look at the code where you call commit (http://doc.qt.io/qt-5/qsavefile.html#commit) on the QSaveFile. It states that if a write error occurs then it will delete the temporary file and return false, otherwise it renames the temporary file. In either case there should be no temporary file left behind, but I have shown that the tempory file stays on the system. Maybe dropbox prevents files from being created and deleted too quickly (a small delay might fix this)?
But still that does not explain why saving fails in the first place. Investigation still required.
@ Temporary file: If
commit()promises to leave no temporary file no matter if successful or not, this is likely a bug or false documentation.I've now setup a dropbox for testing, but I still cannot reproduce this issue.
I noticed that on my laptop, running texstudio v2.11.2, I do not have this problem even though it is working in the same configuration of dropbox folders. The only difference I can see from my laptop to my desktop are the following:
I recently tried TeXstudio 2.11.2 (hg 6192:72f68414a729) (portable) on 2 files, both that have Windows File History enabled.
To sum up so far (please correct if I misunderstood something):
What if you resume dropbox after pausing. Does saving break again or does it keep working?
If I pause and then resume, saving is still broken.
You wrote that your main computer is using Windows File History.
First: Does it happen on non-dropbox folders which are on the same drive and also using Windows File History?
If so: Is there any chance you can test the dependency on dropbox+Windows File History that?
i.e. deactivate Windows File History (don't know if that is possible) or move the dropbox folder to another drive that is not using Windows File History. Or inversely activate Windows File History on your laptop and test if it breaks the previously working configuration.
I know these are deeper modifications to your setup and you should decide if you want to do them. On the other hand, we have to narrow the possible cause. And dropbox+Windows File History is currently the best guess.
To answer your first question: I am able to save tex files that exists outside of Dropbox (on the same drive that my dropbox folder is located).
I turned off File History for that folder and texstudio was still unable to save.
A quick fix would be to have an advance option added to allow for switching between using the old code and the new QSaveFile code. If you are unable to replicate this error on your side, I know that debugging is going to be a lot of back and forth.
I have this problem as well and it is bugging me pretty badly, see attachment ... (The
(2)etc. were attached only as a consequence of me moving the files to another directory, so not by TeXstudio.)I noticed that when I try hitting Ctrl+S, the file is usually save after the third attempt. And yesterday, when I closed TeXstudio, I saw the process still running and keeping one CPU at 100% for several minutes until I terminated it. I’m using TeXstudio 2.11.2 (hg 6192:72f68414a729) Using Qt Version 5.6.1, compiled with Qt 5.6.1 R on Win7-64 with Dropbox 13.4.21.
I’ll try downgrading with a portable version, so I should be able to try other things with 2.11.2 if that could be of any help, and if I can spare the time at the moment.
Edit: It’s probably no surprise, but I can confirm that the problem does not appear with TeXstudio 2.10.8 (hg 5804:967c6023de2d) Using Qt Version 5.5.1, compiled with Qt 5.5.1 R – (portable). By the way, a big thank you to the TeXstudio team for being so mindful as to a) provide the older versions and b) making it so convenient to transfer settings from one TeXstudio installation to another. There really is a reason (or probably several dozen) why TeXstudio is my favorite editor!
Last edit: doncherry 2016-10-29
Same issue
TeXstudio 2.11.0 (hg 6062:c58c915d7759)
Using Qt Version 5.5.1, compiled with Qt 5.5.1 R
Windows 7 Pro (v6.1.7601 SP 1)
Dropbox v13.4.21 Professional Account
As with others, first two saves fail and produce copies, third save succeeds.
(just copying the info from https://sourceforge.net/p/texstudio/discussion/907840/thread/10e8debe/?limit=25)
There are two reports on tex.sx regarding temporary files filling up dropbox:
http://tex.stackexchange.com/questions/336541/i-need-to-compile-a-few-times-and-a-bunch-of-weird-auxiliary-files-appear-in-my
http://tex.stackexchange.com/questions/336594/texstudio-or-miktex-problem-extra-files-not-the-normal-ones
Same issue here with files saved within dropbox-folder. Will be happy to provide further information or test fixes if needed.
TeXstudio Version 2.11.2-win-qt5.6.1
Windows 10 pro, File history active
Dropbox Version 13.4.21
I temporarily got rid of the issue by downgrading to TeXstudio 2.10.8.
Same issue here with files saved within dropbox-folder. Will be happy to provide further information or test fixes if needed.
TeXstudio Version 2.11.2-win-qt5.6.1
Windows 7 Enterprise Service Pack 1
Dropbox Version 13.4.21
I temporarily got rid of the issue by downgrading to TeXstudio 2.10.8.
I also have this issue.
TeXstudio 2.11.2 (hg 6192:72f68414a729) Using Qt Version 5.6.1, compiled with Qt 5.6.1 R
Windows 7 Home Premium SP 1 (build 7601)
Dropbox version 13.4.21
Laptop: texstudio v2.11.0; Dropbox Version 13.4.21; Windows 7 Pro and Dropbox on same SSD but on different partitions (C: and D:) - No Problems
Desktop: texstudio v2.11.0; Dropbox Version 13.4.21; Windows 7 Pro on SSD (C:) and dropbox on HDD (D:) - Have the mentioned problem with the temporary files. Sometimes the save works as expected but mostly I have to try three times.
Dropbox
Last edit: Legge 2016-11-04
I've uploaded a development snapshot:
https://sourceforge.net/projects/texstudio/files/texstudio/TeXstudio%20development/texstudio-2.11.3-dev-hg6281-win-qt5.6.2.exe/download
There's now an option
Options -> Advanced Editor -> Special Options -> Safe writing of files. Deactivating this restores the old (<2.11.0) way of saving files.Thanks for the fast fixing, the saving option works!
This version, however, has introduced a new bug related to
\todo{foo}-notes and the way they’re displayed in the structure tree. This document:leads to 3 + 6 todo notes in the structure tree (instead of 2, see attachment), so the problem seems to be related to backlashes preceding
\todo.I’m using Win7-64 and "TeXstudio 2.11.3 (hg 6281:f89ef8a4cfbd) This is a development version. Using Qt Version 5.6.2, compiled with Qt 5.6.2 R".
Indeed this is a bug. But it already shows up in 2.11.2. Since it's not related, I've transfered it to a separte bug report: https://sourceforge.net/p/texstudio/bugs/1970/
Hello Tim,
First of all, thank you for your kind support.
I downloaded and installed your dev version, but the option you mention is not there under "Special Options".
Also, during installation of this .exe when selecting whether to create a desktop icon or not the install wizard goes back to the first "select language" prompt and starts over.
I was also having the same problem saving to a Dropbox folder. After updating to the dev snapshot and unchecking the
Safe writing of filesoption the issue went away.More interestingly, though, is that without unchecking this box the dev snapshot version now gives the appropriate warning. The warning is:
That's to be expected. I've added the warning as well :). Anyway, thanks for the confirmation of the proper error message.
bug reported upstream to Qt: https://bugreports.qt.io/browse/QTBUG-57299
The RC version texstudio-2.12.0-rc does the trick. I don't see the safe save option but now the irksome nonsaving is gone!
When is the stable version expected?