{"action":"created","issue":{"url":"https://api.github.com/repos/raszi/node-tmp/issues/46","labels_url":"https://api.github.com/repos/raszi/node-tmp/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/raszi/node-tmp/issues/46/comments","events_url":"https://api.github.com/repos/raszi/node-tmp/issues/46/events","html_url":"https://github.com/raszi/node-tmp/issues/46","id":58854124,"number":46,"title":"Function like `tmp.open` to create write stream.","user":{"login":"dantman","id":53399,"avatar_url":"https://avatars.githubusercontent.com/u/53399?v=3","gravatar_id":"","url":"https://api.github.com/users/dantman","html_url":"https://github.com/dantman","followers_url":"https://api.github.com/users/dantman/followers","following_url":"https://api.github.com/users/dantman/following{/other_user}","gists_url":"https://api.github.com/users/dantman/gists{/gist_id}","starred_url":"https://api.github.com/users/dantman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantman/subscriptions","organizations_url":"https://api.github.com/users/dantman/orgs","repos_url":"https://api.github.com/users/dantman/repos","events_url":"https://api.github.com/users/dantman/events{/privacy}","received_events_url":"https://api.github.com/users/dantman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-25T05:51:01Z","updated_at":"2015-08-06T21:53:32Z","closed_at":null,"body":"`tmp.file` has some nice advantages (implicit mode and exclusive) but code using the file descriptor from `fs.open` is rare nowadays.\r\n\r\nAn alternate version that would return a stream made with `fs.createWriteStream` would be nice."},"comment":{"url":"https://api.github.com/repos/raszi/node-tmp/issues/comments/128520157","html_url":"https://github.com/raszi/node-tmp/issues/46#issuecomment-128520157","issue_url":"https://api.github.com/repos/raszi/node-tmp/issues/46","id":128520157,"user":{"login":"silkentrance","id":6068824,"avatar_url":"https://avatars.githubusercontent.com/u/6068824?v=3","gravatar_id":"","url":"https://api.github.com/users/silkentrance","html_url":"https://github.com/silkentrance","followers_url":"https://api.github.com/users/silkentrance/followers","following_url":"https://api.github.com/users/silkentrance/following{/other_user}","gists_url":"https://api.github.com/users/silkentrance/gists{/gist_id}","starred_url":"https://api.github.com/users/silkentrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silkentrance/subscriptions","organizations_url":"https://api.github.com/users/silkentrance/orgs","repos_url":"https://api.github.com/users/silkentrance/repos","events_url":"https://api.github.com/users/silkentrance/events{/privacy}","received_events_url":"https://api.github.com/users/silkentrance/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T21:53:32Z","updated_at":"2015-08-06T21:53:32Z","body":"@dantman a temporary file is by nature a new file, thus the \"w\" and not the \"wx+\" flags. That being said, the behaviour of tmp in this case is absolutely correct.\r\nAnd the flags you presented are the standard flags when opening the file, see\r\n\r\nhttps://github.com/raszi/node-tmp/blob/master/lib/tmp.js#L37\r\n\r\nHowever, if node fs.createFileStream from an existing file descriptor diverges from the flags being used when creating the file descriptor, this is rather an issue of node itself, don´t you think?\r\n\r\nEither way, I will have a look into this and provide you with an answer tomorrow, as I need to look up the file stream api."}}