LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

output/input redirection

Here is a very simple code :
#include
#include
void main( void ){
printf("Output testing\n");
exit(0);
}

I can compile and run it either in CVI or MSVC. If in a command prompt window I run the command :
MyProgram>log.txt
Then using the MSVC version works fine and I get the expected file on disk. However, using CVI I got an empty txt file.
Do you have any idea about what is going on and why the CVI version is not working ?

By the way the "usefull" but non ANSI C following functions are not available in CVI :

1- isatty
2- fileno

Do you have any idea about how I could emulate them ?
Regards, Philippe
0 Kudos
Message 1 of 3
(2,543 Views)
Concerning the first point I found out the solution : Simply make sure you check "Create Console Application" in the "Target Settings" dialog box.

Once this is done, you must call the application from a Command Prompt Window. No output file is created if you strike SHIFT F5.

I did'nt find out solution for iastty and fileno function calls.
0 Kudos
Message 2 of 3
(2,543 Views)
Hello

CVI is an ANSI C compiler, so you probably wont find most of the POSIX functions available with the compiler. But if you can find C libraries that implement these functions, you can always use those with CVI. And CVI does provide libraries that will work with other compilers as well, since some other compilers might implement the functions you need.

I know this isnt the answer you were looking for but I hope this explains things

Thanks

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 3 of 3
(2,543 Views)