GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Revert "fs: deprecate fs.read's string interface" · nodejs/node@3e32ff5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • fs.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const isWindows = process.platform === 'win32';
3535

3636
const DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
3737
const errnoException = util._errnoException;
38-
const printDeprecation = require('internal/util').printDeprecationMessage;
3938

4039
function throwOptionsError(options) {
4140
throw new TypeError('Expected options to be either an object or a string, ' +
@@ -585,14 +584,9 @@ fs.openSync = function(path, flags, mode) {
585584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
586585
};
587586

588-
var readWarned = false;
589587
fs.read = function(fd, buffer, offset, length, position, callback) {
590588
if (!(buffer instanceof Buffer)) {
591589
// legacy string interface (fd, length, position, encoding, callback)
592-
readWarned = printDeprecation('fs.read\'s legacy String interface ' +
593-
'is deprecated. Use the Buffer API as ' +
594-
'mentioned in the documentation instead.',
595-
readWarned);
596590
const cb = arguments[4];
597591
const encoding = arguments[3];
598592

@@ -642,17 +636,12 @@ function tryToStringWithEnd(buf, encoding, end, callback) {
642636
callback(e, buf, end);
643637
}
644638

645-
var readSyncWarned = false;
646639
fs.readSync = function(fd, buffer, offset, length, position) {
647640
var legacy = false;
648641
var encoding;
649642

650643
if (!(buffer instanceof Buffer)) {
651644
// legacy string interface (fd, length, position, encoding, callback)
652-
readSyncWarned = printDeprecation('fs.readSync\'s legacy String interface' +
653-
'is deprecated. Use the Buffer API as ' +
654-
'mentioned in the documentation instead.',
655-
readSyncWarned);
656645
legacy = true;
657646
encoding = arguments[3];
658647

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.