LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a directory within CVI?

How do I create a directory from within CVI?
0 Kudos
Message 1 of 12
(6,697 Views)

Creates a new directory based on the specified directory name.

Note:  Only one directory can be created at a time.

/*-------------------- Prototype ---------------------*/
int MakeDir (char Directory_Name[]);

Utility Library\Diretory Utilities
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 2 of 12
(6,693 Views)

This seems really straight forward, but for some reason adding a call to MakeDir gives this error when I compile:

 

Undefined symbol '_MakeDir@4' referenced in "report.c"

 

However, I have included utility.h. So I'm not sure what the problem is. Also, the project is real-time only. Any ideas?

0 Kudos
Message 3 of 12
(6,152 Views)

Maybe CreateDirectoryA might work (according to http://zone.ni.com/reference/en-XX/help/370051K-01/cvirtmodulehelp/windowssdkfuncsinrt/ this function should be available in RT)

For parameter definition see windows sdk help.

0 Kudos
Message 4 of 12
(6,108 Views)

I found kernel32_lvrt.lib on my desktop. I couldn't find any header files. How do I go about including this library in my project?

0 Kudos
Message 5 of 12
(6,106 Views)

windows.h

put it at top of your includes

0 Kudos
Message 6 of 12
(6,101 Views)

Thanks, I'm having trouble finding documentation for the sdk library.

0 Kudos
Message 7 of 12
(6,094 Views)

in CVI: Help/Windows SDK

 

What i forgot to say: you must have Windows SDK installed with CVI.

 

Here an extract:

 

BOOL CreateDirectory(
  LPCTSTR lpPathName,                         // directory name
  LPSECURITY_ATTRIBUTES lpSecurityAttributes  // SD
);

 

You can set lpSecurityAttributes to 0 for RT systems.

 

 

 

 

0 Kudos
Message 8 of 12
(6,090 Views)

So am I to gather that the utility.h and/or the MakeDir method is not RT safe?  Is this why it does not work?

0 Kudos
Message 9 of 12
(6,000 Views)

I don't know if it is safe or not. I only know that this function is not contained in the RT library.

 

Maybe a National Instruments representative can answer this question.

 

In the meantime you can use the SDK funktion.

... and while there is a workaround there is no need to change anything Smiley Wink

0 Kudos
Message 10 of 12
(5,977 Views)