Repository navigation
Conversation
Fixes haskell#57 Fixes haskell#58 Wrt haskell#6 (only partly fixed)
|
Another way could be like the which then generates those Flags conveniently from The open_ :: CString
-> OpenMode
-> [Flags]
-> Maybe FileMode
-> IO Fd
open_ str how optional_flags maybe_mode = do
fd <- c_open str all_flags mode_w
return (Fd fd)
where
all_flags = unionFlags $ optional_flags ++ [open_mode] ++ creat
(creat, mode_w) = case maybe_mode of
Nothing -> ([],0)
Just x -> ([oCreat], x)
open_mode = case how of
ReadOnly -> oRdonly
WriteOnly -> oWronly
ReadWrite -> oRdwr |
|
seems there is zero interest? |
|
Busy time of year for many ! Unrelatedly: for our posix apis should we be using closed sums or slowly On Wednesday, September 21, 2016, Julian Ospald <[email protected]
|
|
Can some of the developers look into this? Seems like a very useful PR. |
|
No time to maintain this. Developers are not responsive. |
|
@hvr you never gave feedback on this :( |
|
Sorry, totally missed this one. So I see a couple of issues with the current approach; afaik the additional flags (O_NOFOLLOW, O_CLOEXEC, O_DIRECTORY and O_SYNC) were recent additions to the POSIX spec (they weren't yet part of the 2004 edition; they started appearing in the 2016 edition), and I'm not sure about how portable they are, so we may need to account for the possibility they aren't available everywhere. And this poses the question how to deal when they're not available, and how to signal this to API consumers (c.f. #23) . Another issue is that the representation chosen requires us to make version major bumps whenever we add or remove fields from the That being said, the upcoming |
Fixes #57
Fixes #58
Wrt #6 (only partly fixed)