LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically create file

Hi,
I can't find the function allowing me to programatically create a file in a folder what I'd like to do is to use DirSelectPopup function to allow user to select a directory and then prograammatically create a text file which name is the actual date and time.
Also I'd like the first line of the file to contain headers with the names of my measurement values.

Thanks
Olivier
0 Kudos
Message 1 of 5
(3,940 Views)

Well, I'd usually start with either fopen() (ANSI) or OpenFile() (CVI) and work from there. Smiley Wink

JR

0 Kudos
Message 2 of 5
(3,939 Views)
Hi,
Thanks it works now

Olivier
0 Kudos
Message 3 of 5
(3,896 Views)

Sorry, super old thread, but OpenFile doesn't appear to create the file if it doesn't already exist.  Am I missing somthing?

0 Kudos
Message 4 of 5
(3,351 Views)

Yep, I was missing something.  I originally attempted this:

 

handleLogFile = OpenFile(logfilename,VAL_READ_ONLY,VAL_APPEND,VAL_ASCII);

 But the VAL_READ_ONLY won't create the file if OpenFile fails.  Instead, a VAL_READ_WRITE must be used.

0 Kudos
Message 5 of 5
(3,346 Views)