LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do you have to explicitly open a file before Deny Access?

I tried running deny access after reading a file and when I tried to write to it, it gave me an error 8, a permission error. So I tried adding an explicit "Open", and it looks like that works. For this example:

deny access.PNG

there's no error at the first error cluster but there is one for the second. Any ideas why this is? I tested this in LV 8.6.1.

CLED (2016)
0 Kudos
Message 1 of 2
(2,000 Views)

The help to the "Read from Text File" function says: 

"... If you wire a path to file, the function opens the file before reading from it and closes it afterwards."

So the write file function will have to reopen the file, but this time access is denied.

When opening the file ref explicitely the reference remains valid until it is closed explicitely.

 

 

0 Kudos
Message 2 of 2
(1,988 Views)