System.Posix (symbolic links)

sebc at macs.hw.ac.uk sebc at macs.hw.ac.uk
Sat Nov 29 19:37:12 EST 2003


You need to use getSymbolicLinkStatus instead of getFileStatus, which
always follows symbolic links (I guess getSymbolicLinkStatus uses the
stat system call, while getSymbolicLinkStatus uses lstat).

-- 
Sebastien

On Sat, Nov 29, 2003 at 08:24:08PM +0100, Johannes Goetz wrote:
> Hi! Sorry for posting this message twice. Last message had wrong subject.
> 
> Calling isSymbolicLink always returns False... (ghc-6.0.1linux binary 
> tarball)
> It doesn't make a difference whether the symbolic link points
> to a regular file or a directory.
> Test code:
> 
> #ln -s test link
> #ghc Test.hs -o test
> #./test
> False
> #
> 
> Test.hs:
> 
> module Main(main) where
> import System.Posix
> main = do
> status <- getFileStatus "link"
> print (isSymbolicLink status)
> 
> 
> Johannes
> 
> _______________________________________________
> Haskell mailing list
> Haskell at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://haskell.org/pipermail/haskell/attachments/20031129/521a28a1/attachment.bin


More information about the Haskell mailing list