-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
module: allow long paths for require on Windows
#1801 introduced internal fs methods to speed up require. The methods do not call path._makeLong like their counterpart from the fs module. This brings back the old behaviour. Fixes: #1990 Fixes: #1980 Fixes: #1849 PR-URL: https://github.com/nodejs/io.js/pull/1991/files Reviewed-By: Bert Belder <[email protected]>
- Loading branch information
1 parent
52a822d
commit 671e64a
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
var common = require('../common'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var assert = require('assert'); | ||
|
||
// make a path that is more than 260 chars long. | ||
var fileNameLen = Math.max(261 - common.tmpDir.length - 1, 1); | ||
var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x')); | ||
var fullPath = path.resolve(fileName); | ||
|
||
common.refreshTmpDir(); | ||
fs.writeFileSync(fullPath, 'module.exports = 42;'); | ||
|
||
assert.equal(require(fullPath), 42); | ||
|
||
fs.unlinkSync(fullPath); |
671e64a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piscisaureus FYI this came in with
PR-URL: https://github.com/nodejs/io.js/pull/1991/files
, i.e. copypasta of/files
in the url