LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

file operation

Solved!
Go to solution

Hi Wolfgang, I'm at final stage of this project. Now I need 2 help from you,

1) I need to create a file and name that file ,the name of that file should be as same as selected file from fileseletpopup instruction. I have used SplitPath and got the file name and stored it in buff how to open new writable file with same name. Please help!.

 

2. I need to write integer data to the new writable created, what function to use for writing the data?

0 Kudos
Message 11 of 15
(884 Views)

Hi,

the answer to question 1 can be found a few posts above - OpenFile is a function to open a file for reading or writing... here for readwritemode you would specify VAL_WRITE_ONLY

 

For writing data you would chose another function from the Formatting and I/O Library, i.e., FmtFile ( file_handle, "%d", number ). Some examples for it can be found here

0 Kudos
Message 12 of 15
(876 Views)

Hi, the problem here is, I need to open new binary output file and name that file as same as input file. I've extracted input file name from SplitPath but I'm not able to name output file same as input file.

0 Kudos
Message 13 of 15
(870 Views)
Solution
Accepted by topic author vinaypooja

Hi vinaypooja,

the problem here is that you don't spend time to read the manual (even if I provide you with the links)...Smiley Frustrated

1. Of course the name of the output file can be the same as of the input file - but if you open it with readonly or writeonly you cannot read and write to it at the same time. One solution is to first close the input file and then open the output file.

2. If you want to write a binary file all you have to do is to specify the respective parameter in OpenFile.

Message 14 of 15
(859 Views)

i complete this work one week ago with your help, Thank you.

0 Kudos
Message 15 of 15
(830 Views)