Add BlockCount and BlockSize types to System.Posix.Types.
Needs RevisionPublic

Authored by puvar on Nov 18 2018, 9:02 PM.

Details

Summary

I'd like to add the following two functions to System.Posix.Files:
blockSize :: FileStatus -> BlockSize
blockCount :: FileStatus -> BlockCount

These fields of the stat record are specified by POSIX (see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html), but Haskell accessors for them are currently missing.

As System.Posix.Files is defined in unix.git repo, I need to check in the types first. See my pull request to unix package: https://github.com/haskell/unix/pull/123

Test Plan

Recompiled all ghc. Also tested with my local patched version of unix package.

puvar created this revision.Nov 18 2018, 9:02 PM
puvar updated this revision to Diff 18758.Nov 18 2018, 9:07 PM
This comment was removed by puvar.
puvar edited the summary of this revision. (Show Details)Nov 18 2018, 9:15 PM
puvar edited the summary of this revision. (Show Details)Nov 18 2018, 9:18 PM
tdammers requested changes to this revision.Nov 19 2018, 4:37 AM
tdammers added a subscriber: tdammers.

I only see the types defined, but not the actual accessors mentioned in the comment. Are you sure you have committed all changes?

This revision now requires changes to proceed.Nov 19 2018, 4:37 AM
puvar edited the summary of this revision. (Show Details)Nov 19 2018, 12:43 PM

I only see the types defined, but not the actual accessors mentioned in the comment. Are you sure you have committed all changes?

The accessors are defined in unix package which is a separate repo. I need to check in the types in base first. I updated the description to explain that.

puvar edited the summary of this revision. (Show Details)Nov 19 2018, 2:10 PM