mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 06:09:20 +00:00

It is a maintenance burden that was removed from the docs in 2010 (c93e0aaf06
) and runtime-deprecated in v6.0 (1124de2d76
). PR-URL: https://github.com/nodejs/node/pull/9683 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
20 lines
642 B
JavaScript
20 lines
642 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const path = require('path');
|
|
const Buffer = require('buffer').Buffer;
|
|
const fs = require('fs');
|
|
const filepath = path.join(common.fixturesDir, 'x.txt');
|
|
const fd = fs.openSync(filepath, 'r');
|
|
const bufferAsync = Buffer.alloc(0);
|
|
const bufferSync = Buffer.alloc(0);
|
|
|
|
fs.read(fd, bufferAsync, 0, 0, 0, common.mustCall(function(err, bytesRead) {
|
|
assert.equal(bytesRead, 0);
|
|
assert.deepStrictEqual(bufferAsync, Buffer.alloc(0));
|
|
}));
|
|
|
|
const r = fs.readSync(fd, bufferSync, 0, 0, 0);
|
|
assert.deepStrictEqual(bufferSync, Buffer.alloc(0));
|
|
assert.equal(r, 0);
|