-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Change to check the existence of vim_tempdir #11284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Since vim_tempdir cached on Windows may not exist, change it to check the existence. It is presumed to be removed by the antivirus software cleanup process.
Good idea, confirmed as follows:
|
For performance reasons. I did suggest doing something like this years ago, but Bram did not want to check for the existence of the path everytime a temp path was created. Rather it was pointed out, that the temporary directory should not be removed (and the system is brocken). |
Some more information. See here: and here for my old patch: |
Thanks @chrisbra !
I would guess creating a file is far more expensive than I agree that a temp dir going missing is indicative of a broken system, so we should (also) show an error . Something like this: if (vim_tempdir == NULL || !os_isdir(vim_tempdir)) {
if (vim_tempdir != NULL) {
emsgf("EXX: tempdir went missing (antivirus or misconfigured cleanup job?)");
XFREE_CLEAR(vim_tempdir);
}
vim_maketempdir();
} |
If you are re-creating the temp directory, why bothering with an error message? |
Because such a system is likely in a bad state and even after creating the directory, some plugins are likely broken. |
This will close #1432 |
@erw7 Any issues with adding the error message? |
Yes, I think we should add an error message as well. I think the reason I didn't add the error message is because I didn't know how to assign |
Since
vim_tempdir
cached on Windows may not exist, change it to check the existence. It is presumed to be removed by the antivirus software cleanup process.Fixes #11250
Fixes #9833
Fixes #1432
Related: f50135a stdpath("run")