LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File deletion problem

I have a vi, and when it is run the very first thing I want to do is to delete an existing results file. However I get the the following error:

Warning 6 occurred at an unidentified location.
Possible reasons:
LabVIEW: Generic file I/O error.

The file is closed and the path is correct, as I use the same path to write the file, which works.

What am I missing here?

Thanks for the help,
Mike
0 Kudos
Message 1 of 6
(3,198 Views)
Is the file being deleted? You said this is a warning, this usually means that something was done improperly, but that the operation succeeded...most of the time.

Also, instead of deleting the file, just overwrite it.
0 Kudos
Message 2 of 6
(3,198 Views)
No, the file is not being deleted.

If I just overwrite it, I get a dialog box asking if I
want this file to be replaced. My goal is to not have any user interaction with the writing of the new file,
that is why I was trying to delete it.

So, any other ideas? Is there a way to prevent the above stated dialog box from coming up when overwirting the file?

Thanks,

MIke
0 Kudos
Message 3 of 6
(3,198 Views)
Can you post or send me your code. I tried this, and was successful. I'm not sure what you are doing wrong, except that maybe you don't have the filename correct.
0 Kudos
Message 4 of 6
(3,198 Views)
Mike,

Are you using "Write Characters to File.vi" which has the T (Append) or F
(New or Replace) terminal? This function actually opens, writes and then
closes the file.

Or are you using the basic "Write File" function which requires the "Open
File.vi" to actually gain access to the file. The "Open File.vi" has a
control called "advisory dialog?" the is by default set to true.

You can modify the Open File.vi so that the "advisory dialog?" is set to
false and the dialogs won't come up, but, I'd advise saving a local copy of
the modified Open File.vi, rather than permanently changing the LabView
built in functions.

Good luck,
Bill

Mgann wrote in message
news:506500000005000000908B0000-1023576873000@exchange.ni.com...
> No, the
file is not being deleted.
>
> If I just overwrite it, I get a dialog box asking if I
> want this file to be replaced. My goal is to not have any user
> interaction with the writing of the new file,
> that is why I was trying to delete it.
>
> So, any other ideas? Is there a way to prevent the above stated dialog
> box from coming up when overwirting the file?
>
> Thanks,
>
> MIke
0 Kudos
Message 5 of 6
(3,198 Views)
Thanks for the suggestions Bill, but I am using the "Write to Spreadsheet" function, which opens writes and closes the file.

I sent my file to Labview Guru, and he found my problem.

I had two file paths, one pointing to a directory where my data files are, and one pointing to my results file. What I meant to do was to connect the path for my results file to the file deletion. What I actually did was connect my data file path, which just points to a directory, to the deletion function. I have been looking at this for several days, and did not see what I had actually done. I only saw what I "meant" to do.

So, it is now working as it should. Thanks for the help.

Mike
0 Kudos
Message 6 of 6
(3,198 Views)