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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

current disk and directory tree

hello,

I am not a great accustomed with Labwindows cvi.

We made some important measurement and I want to save the measurement file on a specific place in a network drive.

 

I would like

1- work on a current disk other than C (ex : FARADAY (Y:) a network hard)

2- create a directory and sub-directory tree with some name declared on the GUI interface

3- finally, create the file with its name declared on the GUI interface

 

Somebody can help me with a exemple, please?

Thanks in advance

christophe

 

0 Kudos
Message 1 of 2
(2,374 Views)

Hello Cristophe,

if you can let the user interactively choose the folder/file to work with you can use FileSelectPopup or DirSelectPopup to obtain the pathname.

Alternatively pathnamets can be built up by using MakePathname function.

You can also use SetDrive to make a specific drive the current one (e.g. the one FileSelectPopup starts with). In your case, to set drive Y: you need to call SetDrive (24); Starting with the current drive, you can navigate with the appropriate SetDir () calls and even create directories with MakeDir (), provided you have the necessary privileges to do so.

Regarding your last question, file I/O functions like fopen () of OpenFIle () do permit to create a new file with a given file/pathname.

Did you already tried to do something and have some specific question we can help you with?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,364 Views)