Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

Saving files in program files

$
0
0

Hey everyone, I am using CVI 2013 for an academic research.


In the program I made, I allowed the user to choose any directory for the output files using "DirSelectPopup".

 

The problem is when the user choose a protected directory, such as "C:\program files\" (which is, I think, the default folder if the user chose to install the program in c:\program files\) 

 

The output files are in "schrodinger's cat mode" as you can see in the first figure. I can see the files when I try to save files there again, but can not open them. However, as you can see in the second figure, when I try to open the folder manually, the folder is empty and weighted 0 bytes.

I believe that the reason is that program files are considered as highly protected folder. The question is whether I could warn the user from saving in any protected folder. 
I tried the following:
sprintf (FileName, "%s\\%s",DirName,SileName);   

FILE *matchFile = fopen(FileName, "w"); 
if (matchFile == NULL) return 1;
if(FileExists(FileName, 0) != 1) { .... }
But it doesn't work. is there any other exist command in CVI that I could use?

Thanks!

 


Viewing all articles
Browse latest Browse all 5339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>