Opened 5 years ago

Closed 5 years ago

#7345 closed bug (wontfix)

unix- does not provide access to st_blksize and st_blocks

Reported by: JohnWiegley Owned by:
Priority: normal Milestone:
Component: libraries/unix Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


There is currently no clear way in Haskell to determine how much disk space a file actually occupies on disk -- only it's apparent byte size. Case in point, the popular git-annex tool has had to rely on a hack because there is no way to get at the st_blocks information in the POSIX stat record.

I recommend adding two functions to Common.hsc in unix, which are in the attached patch.

Attachments (1)

fileBlocks.patch (1.9 KB) - added by JohnWiegley 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by JohnWiegley

Attachment: fileBlocks.patch added

comment:1 Changed 5 years ago by igloo

difficulty: Unknown
Resolution: wontfix
Status: newclosed

Thanks for the suggestion. However, library API changes need to be discussed on the libraries list first, and then a ticket opened once consensus is reached; please see for details.

Note: See TracTickets for help on using tickets.