• Home
  • Raw
  • Download

Lines Matching full:fs

26 const fs = require('fs');  constant
32 // fs.write with all parameters provided:
35 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
38 fs.closeSync(fd);
40 const found = fs.readFileSync(filename, 'utf8');
44 fs.write(fd, expected, 0, expected.length, null, cb);
48 // fs.write with a buffer, without the length parameter:
51 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
54 fs.closeSync(fd);
56 const found = fs.readFileSync(filename, 'utf8');
60 fs.write(fd, Buffer.from('hello'), 3, cb);
64 // fs.write with a buffer, without the offset and length parameters:
67 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
70 fs.closeSync(fd);
72 const found = fs.readFileSync(filename, 'utf8');
76 fs.write(fd, expected, cb);
80 // fs.write with the offset passed as undefined followed by the callback:
83 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
86 fs.closeSync(fd);
88 const found = fs.readFileSync(filename, 'utf8');
92 fs.write(fd, expected, undefined, cb);
96 // fs.write with offset and length passed as undefined followed by the callback:
99 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
102 fs.closeSync(fd);
104 const found = fs.readFileSync(filename, 'utf8');
108 fs.write(fd, expected, undefined, undefined, cb);
112 // fs.write with a Uint8Array, without the offset and length parameters:
115 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
118 fs.closeSync(fd);
120 const found = fs.readFileSync(filename, 'utf8');
124 fs.write(fd, Uint8Array.from(expected), cb);
128 // fs.write with invalid offset type
131 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
133 fs.write(fd,
146 fs.closeSync(fd);
150 // fs.write with a DataView, without the offset and length parameters:
153 fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => {
156 fs.closeSync(fd);
158 const found = fs.readFileSync(filename, 'utf8');
163 fs.write(fd, new DataView(uint8.buffer), cb);