Fix inconsistency of fexists between Linux and Windows by using POSIX stat instead of fopen
Fix inconsistency of fexists between Linux and Windows by using POSIX stat instead of fopen

Under Linux, fopen succeeds even if the input is a directory and not a file and so fopen can't be used to check if input is for an existing file name or not.
On the hand, stat function provides a cross platform way to detect if the given path exists and also to get its type (file, directory...)
So, in this implementation we use stat

ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring,ring-lang/ring