除 Google Drive 之外的每个文件夹都会出现“我无法在文件上写入”错误

除 Google Drive 之外的每个文件夹都会出现“我无法在文件上写入”错误

我在 Windows 10 上使用带有 TeXStudio 的 MiKTeX,并且试图编译最简单的 TeX 文档:

\documentclass{article}
\begin{document}
A
\end{document}

我收到以下错误:

!我无法在文件“proof.pdf”上写入内容。

目前尚不存在这样的文件,因此这不是在 Acrobat Reader 上打开该文件的常见问题。以下是我的版本信息:

C:\Users\amitt>pdflatex --version
MiKTeX-pdfTeX 4.1 (MiKTeX 20.12)
© 1982 D. E. Knuth, © 1996-2020 Hàn Thế Thành
TeX is a trademark of the American Mathematical Society.
using bzip2 version 1.0.8, 13-Jul-2019
compiled with curl version 7.72.0; using libcurl/7.72.0 Schannel
compiled with expat version 2.2.10; using expat_2.2.10
compiled with jpeg version 9.4
compiled with liblzma version 50020052; using 50020052
compiled with libpng version 1.6.37; using 1.6.37
compiled with libressl version LibreSSL 3.1.4; using LibreSSL 3.1.4
compiled with MiKTeX Application Framework version 4.0; using 4.0
compiled with MiKTeX Core version 4.3; using 4.3
compiled with MiKTeX Archive Extractor version 4.0; using 4.0
compiled with MiKTeX Package Manager version 4.1; using 4.1
compiled with uriparser version 0.9.4
compiled with xpdf version 4.02
compiled with zlib version 1.2.11; using 1.2.11

以下是日志:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.12) (preloaded format=pdflatex 2020.12.22)  22 DEC 2020 11:46
entering extended mode
**./proof.tex
(proof.tex
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-12-07> xparse <2020-03-03>
("C:\Program Files\MiKTeX\tex/latex/base\article.cls"
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
("C:\Program Files\MiKTeX\tex/latex/base\size10.clo"
File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c@part=\count177
\c@section=\count178
\c@subsection=\count179
\c@subsubsection=\count180
\c@paragraph=\count181
\c@subparagraph=\count182
\c@figure=\count183
\c@table=\count184
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
("C:\Program Files\MiKTeX\tex/latex/l3backend\l3backend-pdftex.def"
File: l3backend-pdftex.def 2020-09-24 L3 backend support: PDF output (pdfTeX)
\l__kernel_color_stack_int=\count185
\l__pdf_internal_box=\box47
) (proof.aux)
\openout1 = `proof.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.

! I can't write on file `proof.pdf'.
Please type another file name for output
! Emergency stop.
<argument> ...shipout:D \box_use:N \l_shipout_box 
                                                  
l.5 \end{document}
                  
*** (job aborted, file error in nonstop mode)

 
Here is how much of TeX's memory you used:
 382 strings out of 479696
 6840 string characters out of 2876950
 271423 words of memory out of 3000000
 17563 multiletter control sequences out of 15000+200000
 403430 words of font info for 27 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 43i,4n,49p,129b,100s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!

奇怪的是,这个问题才不是当我尝试编译 Google Drive 同步文件夹中的 TeX 文件时发生这种情况 - 但是它似乎在任何其他文件夹上都会发生这种情况。我不知道这种情况是什么时候开始发生的,因为我通常在 Google Drive 文件夹上工作。

答案1

它是 Avast AntiVirus。我必须批准 pdflatex,让它知道该程序可以更改文件和文件夹。

相关内容