キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/5
4,366件の閲覧回数

Well, I'd usually start with either fopen() (ANSI) or OpenFile() (CVI) and work from there. スマイリー ウインク

JR

0 件の賞賛
メッセージ2/5
4,365件の閲覧回数
Hi,
Thanks it works now

Olivier
0 件の賞賛
メッセージ3/5
4,322件の閲覧回数

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

0 件の賞賛
メッセージ4/5
3,777件の閲覧回数

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 件の賞賛
メッセージ5/5
3,772件の閲覧回数