Skip to content

Add missing blockSize and blockCount accessors to System.Posix.Files. #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

paveluv
Copy link

@paveluv paveluv commented Nov 19, 2018

These fields are specified by POSIX (see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html), but are currently missing.

This change depends on my change to System.Posix.Types: https://phabricator.haskell.org/D5354

@hvr
Copy link
Member

hvr commented Nov 19, 2018

Well, this requires some careful consideration about backward compat with older base versions (and we also try very hard to provide a uniform API -- i.e. no conditional export lists)

Notice the shape of the unix compat matrix at https://matrix.hackage.haskell.org/#/package/unix

I just recalled I've seen something like this already in #78

@hvr
Copy link
Member

hvr commented Nov 19, 2018

Duplicate of #78

@hvr hvr marked this as a duplicate of #78 Nov 19, 2018
@paveluv
Copy link
Author

paveluv commented Nov 20, 2018

If backwards compat is a concern, we can do either: (a) return CBlkSize and CBlkCnt directly, or (b) define BlockSize and BlockCount types in System.Posix.Files. When the new types appear in System.Posix.Types, we can switch to them; it will not break too many things (only for people who explicitly used value constructors in their apps).

As for the XSI concern in diff #78, I don't think we should check for existence of these fields in stat struct. They are present in every POSIX system I'm aware of. XSI is an extension, but it's an extension within POSIX standard, so any POSIX compliant system tends to implement it. So should any library that wraps around POSIX interface.

@Bodigrim
Copy link
Contributor

This is blocked until a) either we drop support of older GHCs, b) or agree our stance on conditional APIs, c) fix backward compatibility in other way.

At the moment all builds are failing, even with newer GHCs.

@hs-viktor
Copy link
Contributor

Should be rebased, and then we can see whether any issues remain now that #175 is merged...

@hs-viktor
Copy link
Contributor

With #78 merged, I'm closing this PR. The only question is whether perhaps the names suggested here blockSize, blockCount are improvements on fileBlockSize, fileBlocks in #78. If so, we could still change that before a release is cut. My take is that the names in #78 look OK, but I hold no strong convictions on the matter.

@hs-viktor hs-viktor closed this Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants