英文:
Can't move image to folder, that is used by express static
问题
我有一个名为"static"的文件夹。这个文件夹被Express静态文件中间件使用。我创建了一个用Go语言编写的服务,用于将图片缩小,以便在前端正确显示。但是当文件被移动到"static"文件夹时,出现了"由于另一个进程正在使用该文件,因此无法访问该文件"的错误。
(在Linux上运行得很好,但在Windows上显示此错误)
如果需要任何代码,请告诉我。
英文:
I have "static" folder. This folder is used by express static. I created service (written in Go) which makes images smaller, so it can properly display on frontend. But when file is being moved to "static" folder it occures "The process cannot access the file because it is being used by another process" error.
(it worked great on linux, but on windows it shows me this error)
Let me know if any code is needed.
答案1
得分: 0
我通过不使用go脚本移动它,而是使用node(这是使用静态文件夹的进程)来解决了这个问题。
英文:
I solved this by not moving it with go script, using node (which is the process that uses static folder) instead.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论