03-12-2012 03:00 PM
When I compile an application as 64-bit running on Win7 64-bit OS, and use the GetFileAttrs function where the Windows Volume (say Z:\) does not exist, the application crashes. In Debug mode, the application simple goes away, whereas in run-time mode, a fatal run-time error occurs.
This behavior is not observed if when application is compiled as 32-bit.
03-12-2012 03:37 PM - edited 03-12-2012 03:41 PM
Hm,
I was wondering if I could reproduce this behavior. What I found out using Win7 64 bit, CVI 2010 is that even in 32 bit debug mode this function causes the program to stop without notice (I don't know if I should call it a crash, but status is not populated):
... something: executed properly
status = GetFileAttrs ( "z:\test.txt", &a, &b, &c, &d );
... something: never executed
Also in my case the volume z does not exist
If I replace z:\test.txt with c:\test.txt I do get a return value of status = -1 (as expected, because I don't have a file test.txt)
03-12-2012 07:08 PM
You are correct, Wolfgang. It does not work for either build.
03-13-2012 09:55 AM
It should be "z:\\test.txt". You are putting a tab in the string by not escaping the backslash.
03-13-2012 10:17 AM
Mohan,
You are right - partially
03-13-2012 10:41 AM
Yes, the "crash" is not acceptable and is a bug and will be fixed in the next release. I just wanted to point out the tab typo.
03-13-2012 10:55 AM
Thanks
03-13-2012 10:59 AM
This issue has been reported internally with ID 343157. Just in case you want to track this. It should be fixed soon.
08-13-2012 05:49 AM
08-13-2012 10:06 AM
You are correct, it is in neither of those reports. It looks like the bug was accidentally mismarked to not be included in the list. It will update the list again.
The bug is fixed in CVI 2012. You should no longer see a crash with this function. Thank you for the feedback.