[MLton] OS.FileSys.isDir

Michael Norrish Michael Norrish <Michael.Norrish@nicta.com.au>
Tue, 5 Apr 2005 16:20:23 +1000


Stephen Weeks writes:
 
> > Under MoscowML, isDir returns false for symbolic links that are
> > links to directories.  Under MLton, isDir returns true.  Which is
> > correct?
 
> Hmmm.  All the implementations of SML that I have, including Moscow
> ML, return true.  The MLton implementation of OS.FileSys.isDir uses
> the Posix stat() system call followed by S_ISDIR, just as I expect
> the other implementations do when on a Unixish system.  I can't
> imagine how returning false is the right behavior.  If you want to
> look at a symbolic link, use Posix.FileSys.lstat.

Sorry, you're quite right. 

I will just have to rewrite my code to check isLink first.

Will endeavour to check my rash claims more thoroughly next time!

Michael.