Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/prelude/Directory/GetPermissions_.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module Directory (getPermissions) where

import NHC.GreenCard
import PatchIOError
import DPermissions



foreign import ccall hs_getperms :: PackedString -> IO (Int,(Bool,Bool,Bool,Bool))

getperms :: FilePath -> IO (Int,Permissions)
getperms tmp1 =
  do let fp = toCString tmp1
     (err,(r,w,x,s)) <- hs_getperms fp
     return (err,(toPerm (r,w,x,s)))



getPermissions :: FilePath -> IO Permissions
getPermissions fp = patchIOErrorFVal "getPermissions" fp getperms

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.