There are already other pecularities between NT and Unix file systems that require similar preprocessor stuff. The Stdio API should only try to hide such things as far as can be done without producing false pretenses. Returning nonzero if the drive letter exists is not disinformation, but putting arbitrary timestamps etc into a Stat struct is.
As for your example, you should use Stdio.is_dir instead. Stdio.exist and Stdio.is_dir should return nonzero in that case and I also consider it a bug that they don't.
/ Martin Stjernholm, Roxen IS
Previous text:
2004-02-12 18:13: Subject: NT problem.
I believe it should. Otherwise you would have to add these kinds of kludges whenever you stumble upon problems:
Stdio.Stat st = file_stat(path)
#ifdef __NT__ if(!st && get_dir(path)) st = Stdio.Stat( ({ 040777, -2, 0,0,0,0,0 }) ); #endif
if(st->isdir) recurse(path); else do_stuff(path);
Is there a good reason why this shouldn't work without the kludge?
/ Martin Nilsson (saturator)