{"action":"created","issue":{"url":"https://api.github.com/repos/Wyamio/Wyam/issues/92","labels_url":"https://api.github.com/repos/Wyamio/Wyam/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/Wyamio/Wyam/issues/92/comments","events_url":"https://api.github.com/repos/Wyamio/Wyam/issues/92/events","html_url":"https://github.com/Wyamio/Wyam/issues/92","id":113461373,"number":92,"title":"ReadFiles Module Locks the files untile end of process","user":{"login":"LokiMidgard","id":389101,"avatar_url":"https://avatars.githubusercontent.com/u/389101?v=3","gravatar_id":"","url":"https://api.github.com/users/LokiMidgard","html_url":"https://github.com/LokiMidgard","followers_url":"https://api.github.com/users/LokiMidgard/followers","following_url":"https://api.github.com/users/LokiMidgard/following{/other_user}","gists_url":"https://api.github.com/users/LokiMidgard/gists{/gist_id}","starred_url":"https://api.github.com/users/LokiMidgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LokiMidgard/subscriptions","organizations_url":"https://api.github.com/users/LokiMidgard/orgs","repos_url":"https://api.github.com/users/LokiMidgard/repos","events_url":"https://api.github.com/users/LokiMidgard/events{/privacy}","received_events_url":"https://api.github.com/users/LokiMidgard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-26T22:06:29Z","updated_at":"2015-10-26T22:15:54Z","closed_at":null,"body":"Some files I have in my project I can't edit while running `--preview`. Normally that are files I don't process like css. While I have no Problem editing `.cshtml` or `.md` files css files are problematic.\r\n\r\nThe problem seems to be that read modules opens a stream which get disposed when ReadFiles will get disposed. But I'm not sure why this doesn't happen for other files. I haven't understood the howl Module and Document Lifecycle with caching yet.\r\n\r\nI could stop this behavior using `File.ReadAllText()` instead of `File.Open()`. But I'm not sure if using a string instead of stream lead to other unwanted behavior."},"comment":{"url":"https://api.github.com/repos/Wyamio/Wyam/issues/comments/151299924","html_url":"https://github.com/Wyamio/Wyam/issues/92#issuecomment-151299924","issue_url":"https://api.github.com/repos/Wyamio/Wyam/issues/92","id":151299924,"user":{"login":"daveaglick","id":1020407,"avatar_url":"https://avatars.githubusercontent.com/u/1020407?v=3","gravatar_id":"","url":"https://api.github.com/users/daveaglick","html_url":"https://github.com/daveaglick","followers_url":"https://api.github.com/users/daveaglick/followers","following_url":"https://api.github.com/users/daveaglick/following{/other_user}","gists_url":"https://api.github.com/users/daveaglick/gists{/gist_id}","starred_url":"https://api.github.com/users/daveaglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveaglick/subscriptions","organizations_url":"https://api.github.com/users/daveaglick/orgs","repos_url":"https://api.github.com/users/daveaglick/repos","events_url":"https://api.github.com/users/daveaglick/events{/privacy}","received_events_url":"https://api.github.com/users/daveaglick/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T22:15:54Z","updated_at":"2015-10-26T22:15:54Z","body":"I haven't experienced this myself (which is interesting), but think I know what's going on. To try and reduce the memory footprint, ReadFiles does use a stream instead of loading the files into memory. However, downstream modules can cause that stream to get disposed of they clone the document with new content (which explains why you don't get locked on Razor or Markdown files).\r\n\r\nWhat I don't understand is why the CSS files are staying locked. The stream should get disposed after the pipelines are done, even if staying around in preview mode. Are you trying to edit the CSS files while the engine is still running a generation, or is this after it's done and you're just in preview mode?\r\n\r\nIt may have something to do with not disposing the Engine while previewing. I'll take a look at this soon too."}}