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

Dumper does not close file/stream (?) #31

Closed
danielkasza opened this issue Apr 25, 2015 · 1 comment
Closed

Dumper does not close file/stream (?) #31

danielkasza opened this issue Apr 25, 2015 · 1 comment

Comments

@danielkasza
Copy link

Hello,

I might be missing something, but this code:

import std.stdio;
import dyaml.all;

void main()
{
    //Read the input.
    Node root = Loader("test.yaml").load();

    //Display the data read.
    foreach(string word; root["Hello World"])
    {
        writeln(word);
    }
    writeln("The answer is ", root["Answer"].as!int);

    //Dump the loaded document to output.yaml.
    Dumper("test.yaml").dump(root);

    //Read it again
    Node root2 = Loader("test.yaml").load();
}

Causes an exception on Windows because Dumper does not close the file when it finished dumping.
image

  • Is this intended behavior?
  • How can I close the file?

My temporary workaround is a close method in Dumper.

Thanks

@kiith-sa
Copy link
Collaborator

kiith-sa commented Jun 3, 2015

Should be fixed by 385cfd5 . Reopen the issue if this still happens.

@kiith-sa kiith-sa closed this as completed Jun 3, 2015
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