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
Acces Denied at Line x
Re: Acces Denied at Line x
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.
Re: Acces Denied at Line x
> 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
> 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