Permission Denied

BlitzMax Forums/BlitzMax Beginners Area/Permission Denied

JBR(Posted 2009) [#1]
Hi, just installed BMAX on my new comp. Vista 64.

I'm looking through the help pages and whenever I click 'Example' it copies the example into the bit correctly but when I run I get the following error.

Building .var
Compiling:.var.bmx
flat assembler version 1.66
3 passes, 3487 bytes.
Linking:.var.debug.exe
C:/Program Files (x86)/BlitzMax/bin/ld.exe: cannot open output file C:/Program Files (x86)/BlitzMax/docs/html/Modules/BASIC/BlitzMax runtime/.var.debug.exe: Permission denied
Build Error: Failed to link C:/Program Files (x86)/BlitzMax/docs/html/Modules/BASIC/BlitzMax runtime/.var.debug.exe
Process complete



-------------------------
If I copy the example to mydocument it works fine.

Is this normal?

Thanks
Jim


GfK(Posted 2009) [#2]
You've probably got User Account Control turned on. When you compile the app its trying to create files in the Program Files folder, and UAC isn't going to let it do that.

Yes, its normal. You can either turn UAC off, as its a pain in the ass anyway. Or you can copy the examples folder to your My Documents folder.


JBR(Posted 2009) [#3]
thanks


Htbaa(Posted 2009) [#4]
Or you can do a right click on the desired map, settings, and then set the user permissions.


Drackbolt(Posted 2010) [#5]
Anyone else have this issue intermittently? I run Win7 64 and whenever I compile, I have to wait half a minute or so before it will allow me to compile and overwrite the file again. Gives me the exact same error as above, only in this case it's temporary. I've looked at UAC, ownership, Indexing and everything else I could think of, to no avail. Pretty irritating.


Dreamora(Posted 2010) [#6]
move it out of programs.

by windows guidelines since back in the XP release time, user data are meant to be in the documents folder, the applications (non changing normally) are the only thing meant for the c:program files folder. With Vista Microsoft has started to enforce it. Even with UAC disabled the program files folder on C behaves special. (its together with the Windows folder one of the two "major security folders" of Windows)


xlsior(Posted 2010) [#7]
The latest release of Blitzmax installs itself to c:\blitzmax instead of under program files, exactly to get around these problems with the default windows settings in place.

Re-install blitz to that folder will resolve your problems.


Dreamora(Posted 2010) [#8]
it would be easier if BM was just made XP+ compliant and move its temp etc into the user appdata/roaming folder where it is meant to be anyway


Drackbolt(Posted 2010) [#9]
I never had it in a windows program folder. The whole bmax installation sits in one folder on a non-boot drive, and my source sits in another folder on that drive. I learned back when Vista came out to avoid certain places on principle, but Windows 7 seems to be doing something more. I've tried disabling indexing and other services but I still can't find what causes this issue. I see it on both my Win7 desktop and laptop, and they were both originally installed in their own directories.
Here is how I can reproduce this at any time:
1. Compile
2. Make one small change to the code and re-compile
3. Long as I waited 30-60 seconds between 1 and 2, I have no problems at all.
4. If only about 30-60 seconds have passed, I get something like this:
Linking:blah.debug.exe
S:/BlitzMax/bin/ld.exe: cannot open output file S:/Storage/Programs/blah.debug.exe: Permission denied
Build Error: Failed to link S:/Storage/Programs/blah.debug.exe
Process complete
5. PLUS, if I go right to cmd or an explorer window and try to manually delete that file, I get the typical "access denied" error as if I didn't own the file or it was in use. But, keep in mind ownership is not a problem, and UAC is very much disabled.

When I'm debugging and making quick changes, this is really sapping my time and enthusiasm. Anyone else at all have this issue?


GfK(Posted 2010) [#10]
Yep, had it a couple of times (which is a really small amount since I probably compile a hundred times a day when I'm having a surge of enthusiasm).

I just hit recompile and it does it.

Oh, and lol @ URL: http://www.gayasoft.ch/ - I completely read that wrong; I saw another 's' in it. :D [edit] That's in dreamora's sig, if anybody has sigs turned off and doesn't know what I'm on about.


Drackbolt(Posted 2010) [#11]
It's annoying because I work like that all the time. Compiling 100 times a day sounds pretty average for me. :) And whatever the lock is, it's so variable that I have to guess on the high end when it will be free; sometimes it's 30 secs, sometimes two minutes. If I keep "hitting" it and trying to recompile when the time isn't up yet, it takes even longer. There must be a reason hidden around here somewhere for this behavior... Because I don't think my computers could hate me that much. ;)

I know at this point it sounds more like Windows behavior than Bmax, but if anyone has ideas, I'd love to hear them.


TaskMaster(Posted 2010) [#12]
I noticed that the path begins with an S:.

Is it a network connection, or an external hard drive? I am guessing that something in the OS or ont he server still has the file locked.

Or, maybe your program is not ending correctly. When you compile, then try to compile again, was the first compile a compile and run? If so, maybe something in your program is staying running afterwards for a short time...


Shortwind(Posted 2010) [#13]
Drackbolt: Any raid going on in this system?

How about system restore?

Anti-virus?

(And I like TaskMaster's question, how about it?) Ever open taskmanager and watch your processes from there to see what the system is doing when you run, quit, compile?


Drackbolt(Posted 2010) [#14]
Thanks for the replies.

S is just my secondary storage partition, and everything's on a single SATA drive. There are no processes left after my program has ended; I'm pretty diligent about freeing resources. System restore is disabled. I have Forefront for anti-virus but I've disabled it and all services completely with no change. I've tried shutting down all other running programs and non-critical services that I understand, still with no change.

I've since read a few other posts online from other people having the same issues, but with different compilers. Most are postulating there may be some kind of write-delay service introduced in Windows 7 causing the issue. I'm working on a few possible workarounds and will post if I find something good.

[UPDATE]
Found the System process is locking the file (thanks to Lockhunter app). No way to manually unlock it. I'll keep looking around.


The_Nici(Posted 2011) [#15]
Hello, sorry for bringing up this old topic.
I've had the same error as Drackbolt for quite a time now, and it's really starting to negatively influence my productivity. I found out that as soon as something accesses an Executable or Batch file, it gets locked and can't be unlocked as administrator. Windows logs don't log anything about that. I turned my antivirus (Kaspersky PURE) off to test it, and still, I just can't delete the file. Unlike in Drackbolt's case, Windows Explorer can somehow delete the file on SHIFT+Delete, but one refresh later it's there again.
I am logged in as administrator, I have the rights to do whatever I want in that folder.

The problem also shows up when I try to delete an executable with an icon which is stored inside it, e.g. when it's changed by resource hacker.

I've got Windows 7 x64 running too. (Ultimate edition) :/ Couldn't find anything helpful with google either.

Last edited 2011


Htbaa(Posted 2011) [#16]
On Windows I always install Unlocker. It's a little freeware app that can display what processes are currently preventing you from deleting a file. You can force the processes to remove the file lock so you can delete it. You could give that a go.


The_Nici(Posted 2011) [#17]
As Drackbolt already said, it's the System process, you can't unlock it manually.