Acces Denied at Line x

You can talk about anything related to LB Booster here, not covered in another category
Cheemag
Posts: 2
Joined: Thu Oct 15, 2020 4:17 pm

Acces Denied at Line x

Post by Cheemag »

Hello,

Came across this error at a line: close#1 where #1 is a text file opened for input. No such error closing #2, the
associated output file.

I just left the handle unclosed and it worked fine !

This was just after I had a false positive from Kaspersky Internet Security 2020. These two problems related ?

(I solved the false positive by filling in the version, copyright etc in the compiler)

Regards

Cheemag
guest
Site Admin
Posts: 192
Joined: Tue Apr 03, 2018 1:34 pm

Re: Acces Denied at Line x

Post by guest »

Cheemag wrote: Thu Oct 15, 2020 4:27 pmCame across this error at a line: close#1 where #1 is a text file opened for input. No such error closing #2, the associated output file.
Are you certain your program never writes to #1 (accidentally)? That would be the simplest explanation for this error: writing a small amount of data to an 'input' file will only raise an error when the file is closed, and it tries to flush the buffered data to the disk.
Cheemag
Posts: 2
Joined: Thu Oct 15, 2020 4:17 pm

Re: Acces Denied at Line x

Post by Cheemag »

> Are you certain your program never writes to #1 (accidentally)? That would be the simplest explanation for this error: writing a small
> amount of data to an 'input' file will only raise an error when the file is closed, and it tries to flush the buffered data to the disk

Yes, of course it writes to #1 otherwise there'd be no point in opening it, surely ?

This is the part of the prog that was causing the error. It no longer does (apparently after solving the false positive). It runs and
compiles without error.

===================================================================================

open"Log.txt"for input as#1:open"Udxf.txt"for append as#2
print#2,"":print#2,b$:print#2,""

while eof(#1)=0

line input#1,a$:if left$(a$,2)="__" then exit while
print#2,a$

wend
print#2,"______________________________________________________"

close#1:close#2

======================================================================================

I had ownership of all the files and directories involved.

Regards,

Cheemag
guest
Site Admin
Posts: 192
Joined: Tue Apr 03, 2018 1:34 pm

Re: Acces Denied at Line x

Post by guest »

Cheemag wrote: Fri Oct 16, 2020 10:45 am Yes, of course it writes to #1 otherwise there'd be no point in opening it, surely ?
You said: "Came across this error at a line: close#1 where #1 is a text file opened for input". If it's opened for input, you must not write to it.