Sha256: e38b476ad9650a58396da7eb45a5ada3a7c6fa0c27e6c8f3812ba0ff07608818

Contents?: true

Size: 489 Bytes

Versions: 3

Compression:

Stored size: 489 Bytes

Contents

common = require("../common");
assert = common.assert
path = require('path'),
Buffer = require('buffer').Buffer
fs = require('fs')
fn = path.join(common.fixturesDir, 'write.txt');


foo = 'foo'
var fd = fs.openSync(fn, 'w');

written = fs.writeSync(fd, '');
assert.strictEqual(0, written);

fs.writeSync(fd, foo);

bar = 'bár'
written = fs.writeSync(fd, new Buffer(bar), 0, Buffer.byteLength(bar));
assert.ok(written > 3);
fs.closeSync(fd);

assert.equal(fs.readFileSync(fn), 'foobár');

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rednode-0.1.2 ext/node/test/simple/test-fs-write-sync.js
rednode-0.1.1 ext/node/test/simple/test-fs-write-sync.js
rednode-0.1.0 ext/node/test/simple/test-fs-write-sync.js