fs.readFile: don't make the callback before the fd is closed
authorBert Belder <bertbelder@gmail.com>
Fri, 6 Apr 2012 00:54:33 +0000 (02:54 +0200)
committerBert Belder <bertbelder@gmail.com>
Fri, 6 Apr 2012 01:13:56 +0000 (03:13 +0200)
commit40b7302af84be97993c0b17432b331466e99f67c
tree23fe4cbb5f64b23e68bb809b03adb4adc997dcfb
parentf178f2ae3fc6cd24221e8b9548902e18c63ab8e4
fs.readFile: don't make the callback before the fd is closed

On Windows it is not possible to unlink() the read file in the callback.
This fixes #3051. A test is included.
lib/fs.js
test/simple/test-fs-readfile-unlink.js [new file with mode: 0644]