LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to text file returns no error even if the underlying file is deleted

Hi,

 

I'm using a CompactRIO and writing to a text file underneath the C drive.

 

I'm running into an unexpected situation when I am trying to error check my file handling.  I assumed that if the underlying file being written to that was created by open/create/replace vi and written to with the "Write to Text File" vi, would return an error if I delete the file from underneath it in the file system., yet there is no reported error and the function carrys on seemingly successfully writing to a file that has been deleted.  

 

Anyone know why this happens and how to potentiallly remedy?

 

 

0 Kudos
Message 1 of 4
(2,507 Views)

How you will delete file when your reference is live?

 

 

Munna
0 Kudos
Message 2 of 4
(2,480 Views)

Ouch, this obviously isn't ideal but is probably down to the filesystem on the CompactRIO.

 

I would consider putting in a check - doing something like getting the file position from the file might return an error if the file no longer exists.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(2,468 Views)

Thanks for the idea. I'll try that and let you know how it goes.

0 Kudos
Message 4 of 4
(2,376 Views)