{"action":"closed","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/3623","labels_url":"https://api.github.com/repos/nodejs/node/issues/3623/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/3623/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/3623/events","html_url":"https://github.com/nodejs/node/issues/3623","id":114487583,"number":3623,"title":"Writing multiple files on OS X","user":{"login":"speg","id":698301,"avatar_url":"https://avatars.githubusercontent.com/u/698301?v=3","gravatar_id":"","url":"https://api.github.com/users/speg","html_url":"https://github.com/speg","followers_url":"https://api.github.com/users/speg/followers","following_url":"https://api.github.com/users/speg/following{/other_user}","gists_url":"https://api.github.com/users/speg/gists{/gist_id}","starred_url":"https://api.github.com/users/speg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/speg/subscriptions","organizations_url":"https://api.github.com/users/speg/orgs","repos_url":"https://api.github.com/users/speg/repos","events_url":"https://api.github.com/users/speg/events{/privacy}","received_events_url":"https://api.github.com/users/speg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/fs","name":"fs","color":"0052cc"},{"url":"https://api.github.com/repos/nodejs/node/labels/os%20x","name":"os x","color":"9944dd"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-01T19:33:44Z","updated_at":"2015-11-01T23:29:17Z","closed_at":"2015-11-01T23:29:17Z","body":"I was trying to experiment with my understanding of node and wanted to test a simple assumption:\r\n\r\nNode can write to two files at the same time.\r\n\r\n```javascript\r\nfs = require('fs')\r\n\r\nvar bufferA = new Buffer(1e+8)\r\nbufferA.fill(0)\r\n\r\nvar bufferB = new Buffer(1e+0)\r\nbufferB.fill(0)\r\n\r\nvar fileA = fs.openSync('fileA', 'w')\r\nvar fileB = fs.openSync('fileB', 'w')\r\n\r\nconsole.time('A')\r\nfs.write(fileA, bufferA, 0, bufferA.length, function(err) { console.timeEnd('A')})\r\nconsole.time('B')\r\nfs.write(fileB, bufferB, 0, bufferB.length, function(err) { console.timeEnd('B')})\r\n```\r\n\r\nTwo buffers, filled with zeros. A is very large, B is very small. B should finish first?\r\n\r\nOn Linux I get:\r\n```\r\nB: 4ms\r\nA: 306ms\r\n```\r\n\r\nBut on OS X (10.11.1) I get:\r\n```\r\nA: 314.564ms\r\nB: 315.864ms\r\n```\r\n\r\nA commentor on StackOverflow confirms my Linux results on his Windows machine.\r\nI tried with node 5.0, 4.1, and 0.12 on OS X. All similar results. It looks like `fs.write` is waiting for `fileA` to complete until `fileB` can write.\r\n\r\nIs there a known issue with `fs.write` on OS X?"}}