Skip to content
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

encodeHandle #143

Open
kirelagin opened this issue Aug 7, 2018 · 1 comment
Open

encodeHandle #143

kirelagin opened this issue Aug 7, 2018 · 1 comment

Comments

@kirelagin
Copy link

There is already a function to save yaml to a file (encodeFile) but it doesn’t help when I need to save something to a handle (e.g. if I got one from withTempFile).

I think it might be a good idea to change Text.Libyaml.{encode,decode}File to work with a handle.

P.S. In the specific case of withTempFile for some reason just writing to the same file with encodeFile works, while writeFile fails. I have no explanation for this. Might it be a bug somewhere?

@snoyberg
Copy link
Owner

snoyberg commented Aug 8, 2018

I'm OK with adding such functions, PR welcome. I'm guessing encodeFile works because it's following a different code path for opening the file descriptor, as it's passing the content over to the libyaml C library via the FFI and not using Handles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants