[Haskell-cafe] System.Posix.Files.isDirectory and System.Posix.Files.isSymbolicLink

Erik de Castro Lopo mle+cl at mega-nerd.com
Sun Feb 1 18:01:32 EST 2009


Erik de Castro Lopo wrote:

> The following code creates a symbolic link in the current directory
> and then uses System.Posix.Files.getFileStatus to get the status of
> the link.

If I use getSymbolicLinkStatus instead of getFileStatus I get the
result I expect. However, using getSymbolicLinkStatus instead of
getFileStatus is highly counter-intuitive.

Furthermore System.Directory.doesDirectoryExist seems to use
getFileStatus so that if one tries to walk a directory tree one will
also follow symlinks and if those links are circular you get an infinite
loop.

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Christianity: The belief that some cosmic Jewish Zombie can make you live
forever if you symbolically eat his flesh and telepathically tell him that
you accept him as your master, so he can remove an evil force from your
soul that is present in humanity because a rib-woman was convinced by a
talking snake to eat from a magical tree.
-- http://uncyclopedia.org/wiki/Christianity


More information about the Haskell-Cafe mailing list