请在Windows上安装:“访问被拒绝"; [英] go install on windows: "Access is Denied"

查看:73
本文介绍了请在Windows上安装:“访问被拒绝";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Go语言编程的新手.对于我的一个问题,我真的很希望您的帮助.

I am new to programming in Go. I would really like your help regarding one of my problems.

我需要对文件进行安装,该文件的可执行文件(在Windows中)在名为 GOPATH \ bin 的文件夹中创建.

I am required to do go install on a file, the executable of which (in Windows) is created in a folder called GOPATH\bin.

直到现在,我通常遵循以下例程: go install< file> .go ---> < file> .exe .但是,这一次看来,在执行< file> .exe 后,exe暂时没有完成完整的执行,当我 go install .

Until now, I typically followed the routine: go install <file>.go ---> <file>.exe. However, this time it appears that after the execution of <file>.exe, the exe doesn't finish complete executing for a while and I get the following error when I go install again.

C:\ Users \ Rahul \ Desktop \ Compilers \ src \ cs553s2013 \ mylexer>去安装is_digit.go转到安装命令行参数:打开C:\ Users \ Rahul \ Desktop \ Compilers \ bin \ is_ digit.exe:访问被拒绝.

C:\Users\Rahul\Desktop\Compilers\src\cs553s2013\mylexer>go install is_digit.go go install command-line-arguments: open C:\Users\Rahul\Desktop\Compilers\bin\is_ digit.exe: Access is denied.

推荐答案

请参见绝对不知道为什么,但是以上建议起作用了.要解决此问题,必须在Windows 7上启用应用程序体验" Windows服务.

Absolutely no idea why, but the above suggestion worked. One must enable the "Application Experience" windows service on Windows 7 to solve this issue.

我禁用了此服务,并且在项目的二进制文件上看到了类似的2-3分钟奇怪的权限被拒绝"时间(二进制文件在通过alt + F2的$ GOPATH/bin从刷新后也会消失.$ GOPATH/bin的Windows资源管理器视图,Eclipse + Goclipse在其中构建了我的二进制文件).我注意到,在执行之后,并且在二进制文件最终消失之前,它已更改为由某个未知用户拥有(在资源管理器中,它不是由编译用户,管理员甚至是SYSTEM拥有).

I had this service disabled, and was seeing a similar strange 2-3 minute time of "Permission Denied" on my project's binary (the binary would also disappear after a refresh via alt+F2 of $GOPATH/bin, from a Windows Explorer view of the $GOPATH/bin where Eclipse + Goclipse was building my binary). I noticed that just after execution, and before the binary finally disappeared, it was changed to be owned by some unknown user (in Explorer, it isn't owned by the compiling user, Administrator, or even SYSTEM).

我只能推测-如果Windows退出时没有任何未证明的Windows内核正常"状态(假设已崩溃"),则Windows可能会将其保留在文件系统中,因此Application Experience服务可以将其作为诊断数据发送给Microsoft-并且,如果该服务被禁用,Application Experience服务将无法完成NTFS或资源管理器正在等待的握手,以允许该文件被后续编译覆盖.因此,golang .exe以较高的权限坐在那里,与某些系统/未定义用户一起被Eclipse无法删除,直到资源管理器将其标记为肯定已死为止.

I can only speculate -- perhaps Windows keeps any .exe on the filesystem, if it has exited without some sort of undocumented 'all-OK' status to the windows kernel, assuming it 'crashed', so the Application Experience service can send it as diagnostic data to Microsoft -- and if that service is disabled, the Application Experience service can't finalize whatever handshake NTFS or Explorer is waiting for to allow the file to be overwritten by subsequent compiles. So the golang .exe sits there, with elevated permissions, with some system/undefined user, un-deleteable by Eclipse, until Explorer does something to mark it as definitely dead.

这篇关于请在Windows上安装:“访问被拒绝";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆