unix-handle-0.0.0: POSIX operations on Handles

Portabilitynon-portable (requires POSIX)



This module provides versions of functions from System.Posix.Files that operate on Handle instead of FilePath or Fd. This is useful to prevent race conditions that may arise from looking up the same path twice.



hSetMode :: Handle -> FileMode -> IO ()Source

hSetMode h mode acts like setFileMode or setFdMode on a Handle.

Note: calls fchmod.

hGetStatus :: Handle -> IO FileStatusSource

hGetStatus h acts like getFileStatus or getFdStatus on a Handle.

Note: calls fstat.

hSetOwnerAndGroup :: Handle -> UserID -> GroupID -> IO ()Source

hSetOwnerAndGroup h uid gid acts like setOwnerAndGroup or setFdOwnerAndGroup on a Handle.

Note: calls fchown.

hSetSize :: Handle -> FileOffset -> IO ()Source

hSetSize h size acts like setFileSize or setFdSize on a Handle. It is equivalent to hSetFileSize but is provided here for completeness.

hGetPathVar :: PathVar -> Handle -> IO LimitSource

hGetPathVar var h acts like getPathVar or getFdPathVar on a Handle.

Note: calls fpathconf.