From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-05-2010 09:54 AM
Hi guys,
I'm writing data in a text file and I saw if the file is already open in Windows XP the data are not written and I have no error message.
So my question is how can I close the file in Windows with Labview ?
And is there a way to check before closing it if the file is open by Windows ?
I tried with "close file" and with "close file+.vi" but it's not working.
Thanks
01-05-2010 10:23 AM
01-06-2010 02:36 AM
Thank you smercurio_fc for you reply, but I didn't succeed to close my file.
If I understand it right I should look on Microsoft side and not in a function in Labview ?
Like to use the command with the cmd.exe to close it ?
Regards
01-06-2010 07:16 AM
Hi remvu,
I once had the same problem. I used the openfiles command-line command. The example below works but has some weaknesses (is not fully implemented yet). But it should be a good starting point for you...
Cheggers
01-06-2010 08:55 AM
remvu wrote:Thank you smercurio_fc for you reply, but I didn't succeed to close my file.
If I understand it right I should look on Microsoft side and not in a function in Labview ?
Like to use the command with the cmd.exe to close it ?
Yes, it is a command-line program made by Microsoft. The code that cheggers attached is basically how you would use it. As I noted, the utility is designed to track files opened by network users. To track files opened locally you need to run the command with the "/local ON" parameters. You only need to do this once, though a reboot is required. More information can be found on the Microsoft site.