Getting Error 70 Permission Denied on Kill 
Author Message
 Getting Error 70 Permission Denied on Kill


Quote:
>I have a routine that opens a file for input, reads it, line by line,
> closes it and immediately Kills it.  I am getting a Error 70,
> Permission Denied when Killing it.

> Any suggestions on what's causing this and what to do about it?

In which folder does that file resides? In the app's folder or temp folder
for example?

The error means the user doesn't have enough permission to delete the file.
Either you or the user's network administrator has to give that user
permissions. In some case, if the user is choosing which file to open, he
needs to make a copy to a location that he has write access to, such as My
Documents or the Temp folder. If it's something in the app's folder, you
need to relocate the file elsewhere to a location that is writable by the
user, such as under AppData. "Program Files" and sub folders are
Read/Execute only for members of the limited "Users" group.



Sat, 14 Jul 2012 01:41:53 GMT  
 Getting Error 70 Permission Denied on Kill

Quote:

> I have a routine that opens a file for input, reads it, line by line,
> closes it and immediately Kills it.  I am getting a Error 70,
> Permission Denied when Killing it.

> Any suggestions on what's causing this and what to do about it?

The usual problem is a "timing issue". The Close method is merely signalling
to the O/S that the file can be closed, but it doesn't block until it is.

You can easily test for this by placing the "Kill Routine" in another
event - create a dummy button for example. If the file is killed by this
method, then go back an create a Timer. Something like ....
        ...
     ' current routine
         Close fp
         Timer1.Enabled = True
End <routine>

Private Sub Timer1_Timer()
   Kill FileName
   Timer1.Enabled = False
End Sub

If the Dummy Event/Button didn't work, then something else is going on. And
you will need to post more information.

-ralph



Sat, 14 Jul 2012 01:44:40 GMT  
 Getting Error 70 Permission Denied on Kill
Hello,

- the file is really closed ?
- it is not read only ?
- you are also allowed to delete this file and not only to read from this
file ?

Ultimately a tool such as ProcMon
(http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) should
allows to find out why the delete fails...

--
Patrice



Quote:
> I have a routine that opens a file for input, reads it, line by line,
> closes it and immediately Kills it.  I am getting a Error 70,
> Permission Denied when Killing it.

> Any suggestions on what's causing this and what to do about it?



Sat, 14 Jul 2012 02:00:20 GMT  
 Getting Error 70 Permission Denied on Kill

Quote:
> This error is difficult to reproduce so it will take me a day or so to
> know if it's fixed.

Sounds like AV software scanning the file.


Sat, 14 Jul 2012 10:19:40 GMT  
 Getting Error 70 Permission Denied on Kill


Quote:

> On Mon, 25 Jan 2010 11:44:40 -0600, "Ralph"


> >> I have a routine that opens a file for input, reads it, line by line,
> >> closes it and immediately Kills it.  I am getting a Error 70,
> >> Permission Denied when Killing it.

> >> Any suggestions on what's causing this and what to do about it?

> >The usual problem is a "timing issue". The Close method is merely
signalling
> >to the O/S that the file can be closed, but it doesn't block until it is.

> I think you're right about it being a  timing problem.  The odd thing
> about this is the error doesn't occur under most conditions.  But,
> when I revise (open change and save) an entirely unrelated file before
> reading and killing this file, I get the error message.  Other times,
> when I don't revise the unrelated file, the error doesn't occur.

> Rather that insert a persistent delay that will slow the program at
> all times, even when not needed, I am trying a solution where I trap
> the error, add a DoEvents and a Resume.   I loop through this until
> the Kill does not produce an error or two seconds have elapsed.

You don't need to do a DoEvents(). DoEvents is for polling and clearing the
Application's msg/hdw queue. It works in this case because DoEvents also
calls Sleep(0), which surrenders your App's time slice to allow outside
processes (perhaps the AV as Nobody mentioned or the base I/O services) to
run.

Only running a 'loop' when it is needed rather than all the time is a good
idea. But you can accomplish the same using either a sleep or a timer. The
timer has the advantage of allowing your routine to 'continue' (Sleep
blocks) and thus appear more responsive.

But with any scenario you are also wise to provide an additional escape just
in case there is another issue. I would probably do this with a static count
in the Timer event.

-ralph



Sat, 14 Jul 2012 12:45:11 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Error Number : 70 and Error Description : Permission Denied

2. Compile Error - Permission Denied (Error 70)

3. Permission Denied (Error 70)

4. error 70: permission denied for MsgBox

5. winNT: run-time error 70, permission denied ?

6. VB4 & Acc 2 - Error 70 Permission Denied

7. Error 70: Permission Denied (over network)

8. Shell error 70 permission denied

9. runtime error 70 Permission denied:

10. Runtime error '70' Permission denied

11. : Error 70 - Permission Denied

12. VB4 & Acc 2 - Error 70 Permission Denied

 

 
Powered by phpBB® Forum Software