‎09-09-2010 09:13 AM
I've noticed a strange behaviour of FileExists(const char path[], ssize_t **fileSize) function with UNC paths (\\<hostname>\<sharename>[\<objectname>]*😞
\\\\server-name\\folder-name\\file.txt", NULL)
\\\\192.168.1.1\\folder-name\\file.txt", NULL)This happens also if you try with the path to the same file, written with the host IP address and its corresponding alias, when the host becomes unreachable.
Tested with CVI 2009 SP1
Is this an expected behaviour?
‎09-10-2010 09:18 AM
Hello Vix,
I've tried with either CVI 2009 Version 9.1.1 (450) and CVI 2009 Version 9.1.0 (428) and I always get 0 if the alias is bad or the IP is unreachable.
Here's the code I've run:
int ret=0;
ret=FileExists ("\\\\server\\AEs\\pippo.txt", NULL);
printf("Il valore e' %d",ret);
getchar();
Can you give me your exact version of CVI?
Thanks,
Andrea
‎09-10-2010 09:29 AM
Probably I didn't explain the problem very well:
if you use an alias, you'll always get 0.
But if you use the IP address of the alias, you'll get -93.
and the strange thing is that server is simply an alias for 10.2.2.2
‎09-10-2010 10:15 AM
Hello Vix,
now I did the correct test but I always get 0 either with the alias or the IP Address (of the same alias).
What version of CVI are you using?
Ciao,
Andrea
‎09-13-2010 01:07 AM
I used both CVI 6.0 and CVI 2009 SP1 under WinXP Pro SP2.
Did you get 0 when the network address isn't availbale?
Or when the file doesn't exist, but the network resource (alias or IP Address) is availbale?
I found this issue while simulating a kind of network fault simply unplugging my network cable
‎09-13-2010 01:11 AM
The file exists and just lik you did I unplugged the network cable but I always got 0, eithe with alias or IP address...
‎09-13-2010 01:15 AM
This is really strange, because I find the same situation on several PCs connected to different LANs.
The behavioir doesn't change both in debug and in release configuration...
‎11-26-2010 04:26 AM
I have an additional information that could help you reproducing this issue:
‎09-30-2011 03:59 AM
Has been this issue reproduced and/or fixed yet?
‎10-05-2011 06:50 PM
I can't seem to reproduce this even with a VirtualBox XP system. Have you tried this without a virtual machine? Virtual machines tend to be a source of many networking issues.
I am assuming that if you can connect to the server, and the file exists you do get a 1. Is that correct? Are you only getting unexpected behavior when you cannot access the server?
Could you enable logging for the CVI RTE by running C:\Program Files (x86)\National Instruments\CVI2010\bin\ConfigCVILogging.exe (at the correct path on your system and for your version). This will launch an application where you can turn on logging message types. Set the radio button at the top to Runtime Engine and then check all of the message types and output the log to a file. Could you send me this log. Maybe to make it easier for me to read, create one for each scenario. This will help me figure out where to look to see why you might be getting the -93 error.