Odd GetFileFolderInfo behavior

I frequently use GetFileFolderInfo to make sure a path is both valid and points to a file rather than a folder.  Originally the function simply checked whether V_IsFile is equal to 1.  However, if I run GetFileFolderInfo twice, the first time with a valid file path and the second time with an invalid path, V_IsFile does not update and retains the value of 1 from the first time.  The fix on my end is relatively simple: In addition to making sure V_IsFIle is 1, I also make sure V_Flag is 0.  However, this behavior seems rather undesirable, since the results of the operation will not be the same every time and instead depend on whether or not GetFileFolderInfo was called previously in the function.  Setting V_IsFile and V_IsFolder to 0 if V_Flag is non-0 seems like the preferred behavior.

Is there a reason why V_IsFile and V_IsFolder only update when the path is valid, and if this behavior can't be changed, can it at least be documented in the help?

FUNCTION Invalid_Folder_First()

    GetFileFolderInfo/Q/Z "Path to invalid file/folder"
    Print V_Flag            //Will be nonzero
    Print V_IsFolder        //Will be 0
   

    GetFileFolderInfo/Q/Z "Path to valid file/folder"
    Print V_Flag            //Will be 0
    Print V_IsFolder        //Will be 1
   
END


FUNCTION Valid_Folder_First()

    GetFileFolderInfo/Q/Z "Path to valid file/folder"
    Print V_Flag            //Will be 0
    Print V_IsFolder        //Will be 1

    GetFileFolderInfo/Q/Z "Path to invalid file/folder"
    Print V_Flag            //Will be nonzero
    Print V_IsFolder        //Will be 1!! Not expected!

END

 

Igor 8.05 and later will properly reset all the output variables and strings even if the file or folder is not found.