@@ -293,7 +293,7 @@ fs.access = function(path, mode, callback) {
293
293
mode = mode | 0 ;
294
294
var req = new FSReqWrap ( ) ;
295
295
req . oncomplete = makeCallback ( callback ) ;
296
- binding . access ( pathModule . _makeLong ( path ) , mode , req ) ;
296
+ binding . access ( pathModule . toNamespacedPath ( path ) , mode , req ) ;
297
297
} ;
298
298
299
299
fs . accessSync = function ( path , mode ) {
@@ -305,7 +305,7 @@ fs.accessSync = function(path, mode) {
305
305
else
306
306
mode = mode | 0 ;
307
307
308
- binding . access ( pathModule . _makeLong ( path ) , mode ) ;
308
+ binding . access ( pathModule . toNamespacedPath ( path ) , mode ) ;
309
309
} ;
310
310
311
311
fs . exists = function ( path , callback ) {
@@ -314,7 +314,7 @@ fs.exists = function(path, callback) {
314
314
if ( ! nullCheck ( path , cb ) ) return ;
315
315
var req = new FSReqWrap ( ) ;
316
316
req . oncomplete = cb ;
317
- binding . stat ( pathModule . _makeLong ( path ) , req ) ;
317
+ binding . stat ( pathModule . toNamespacedPath ( path ) , req ) ;
318
318
function cb ( err ) {
319
319
if ( callback ) callback ( err ? false : true ) ;
320
320
}
@@ -333,7 +333,7 @@ fs.existsSync = function(path) {
333
333
try {
334
334
handleError ( ( path = getPathFromURL ( path ) ) ) ;
335
335
nullCheck ( path ) ;
336
- binding . stat ( pathModule . _makeLong ( path ) ) ;
336
+ binding . stat ( pathModule . toNamespacedPath ( path ) ) ;
337
337
return true ;
338
338
} catch ( e ) {
339
339
return false ;
@@ -362,7 +362,7 @@ fs.readFile = function(path, options, callback) {
362
362
return ;
363
363
}
364
364
365
- binding . open ( pathModule . _makeLong ( path ) ,
365
+ binding . open ( pathModule . toNamespacedPath ( path ) ,
366
366
stringToFlags ( options . flag || 'r' ) ,
367
367
0o666 ,
368
368
req ) ;
@@ -646,7 +646,7 @@ fs.open = function(path, flags, mode, callback_) {
646
646
var req = new FSReqWrap ( ) ;
647
647
req . oncomplete = callback ;
648
648
649
- binding . open ( pathModule . _makeLong ( path ) ,
649
+ binding . open ( pathModule . toNamespacedPath ( path ) ,
650
650
stringToFlags ( flags ) ,
651
651
mode ,
652
652
req ) ;
@@ -656,7 +656,8 @@ fs.openSync = function(path, flags, mode) {
656
656
mode = modeNum ( mode , 0o666 ) ;
657
657
handleError ( ( path = getPathFromURL ( path ) ) ) ;
658
658
nullCheck ( path ) ;
659
- return binding . open ( pathModule . _makeLong ( path ) , stringToFlags ( flags ) , mode ) ;
659
+ return binding . open ( pathModule . toNamespacedPath ( path ) ,
660
+ stringToFlags ( flags ) , mode ) ;
660
661
} ;
661
662
662
663
fs . read = function ( fd , buffer , offset , length , position , callback ) {
@@ -766,8 +767,8 @@ fs.rename = function(oldPath, newPath, callback) {
766
767
if ( ! nullCheck ( newPath , callback ) ) return ;
767
768
var req = new FSReqWrap ( ) ;
768
769
req . oncomplete = callback ;
769
- binding . rename ( pathModule . _makeLong ( oldPath ) ,
770
- pathModule . _makeLong ( newPath ) ,
770
+ binding . rename ( pathModule . toNamespacedPath ( oldPath ) ,
771
+ pathModule . toNamespacedPath ( newPath ) ,
771
772
req ) ;
772
773
} ;
773
774
@@ -776,8 +777,8 @@ fs.renameSync = function(oldPath, newPath) {
776
777
handleError ( ( newPath = getPathFromURL ( newPath ) ) ) ;
777
778
nullCheck ( oldPath ) ;
778
779
nullCheck ( newPath ) ;
779
- return binding . rename ( pathModule . _makeLong ( oldPath ) ,
780
- pathModule . _makeLong ( newPath ) ) ;
780
+ return binding . rename ( pathModule . toNamespacedPath ( oldPath ) ,
781
+ pathModule . toNamespacedPath ( newPath ) ) ;
781
782
} ;
782
783
783
784
fs . truncate = function ( path , len , callback ) {
@@ -850,13 +851,13 @@ fs.rmdir = function(path, callback) {
850
851
if ( ! nullCheck ( path , callback ) ) return ;
851
852
var req = new FSReqWrap ( ) ;
852
853
req . oncomplete = callback ;
853
- binding . rmdir ( pathModule . _makeLong ( path ) , req ) ;
854
+ binding . rmdir ( pathModule . toNamespacedPath ( path ) , req ) ;
854
855
} ;
855
856
856
857
fs . rmdirSync = function ( path ) {
857
858
handleError ( ( path = getPathFromURL ( path ) ) ) ;
858
859
nullCheck ( path ) ;
859
- return binding . rmdir ( pathModule . _makeLong ( path ) ) ;
860
+ return binding . rmdir ( pathModule . toNamespacedPath ( path ) ) ;
860
861
} ;
861
862
862
863
fs . fdatasync = function ( fd , callback ) {
@@ -887,15 +888,15 @@ fs.mkdir = function(path, mode, callback) {
887
888
if ( ! nullCheck ( path , callback ) ) return ;
888
889
var req = new FSReqWrap ( ) ;
889
890
req . oncomplete = callback ;
890
- binding . mkdir ( pathModule . _makeLong ( path ) ,
891
+ binding . mkdir ( pathModule . toNamespacedPath ( path ) ,
891
892
modeNum ( mode , 0o777 ) ,
892
893
req ) ;
893
894
} ;
894
895
895
896
fs . mkdirSync = function ( path , mode ) {
896
897
handleError ( ( path = getPathFromURL ( path ) ) ) ;
897
898
nullCheck ( path ) ;
898
- return binding . mkdir ( pathModule . _makeLong ( path ) ,
899
+ return binding . mkdir ( pathModule . toNamespacedPath ( path ) ,
899
900
modeNum ( mode , 0o777 ) ) ;
900
901
} ;
901
902
@@ -907,14 +908,14 @@ fs.readdir = function(path, options, callback) {
907
908
if ( ! nullCheck ( path , callback ) ) return ;
908
909
var req = new FSReqWrap ( ) ;
909
910
req . oncomplete = callback ;
910
- binding . readdir ( pathModule . _makeLong ( path ) , options . encoding , req ) ;
911
+ binding . readdir ( pathModule . toNamespacedPath ( path ) , options . encoding , req ) ;
911
912
} ;
912
913
913
914
fs . readdirSync = function ( path , options ) {
914
915
options = getOptions ( options , { } ) ;
915
916
handleError ( ( path = getPathFromURL ( path ) ) ) ;
916
917
nullCheck ( path ) ;
917
- return binding . readdir ( pathModule . _makeLong ( path ) , options . encoding ) ;
918
+ return binding . readdir ( pathModule . toNamespacedPath ( path ) , options . encoding ) ;
918
919
} ;
919
920
920
921
fs . fstat = function ( fd , callback ) {
@@ -930,7 +931,7 @@ fs.lstat = function(path, callback) {
930
931
if ( ! nullCheck ( path , callback ) ) return ;
931
932
var req = new FSReqWrap ( ) ;
932
933
req . oncomplete = callback ;
933
- binding . lstat ( pathModule . _makeLong ( path ) , req ) ;
934
+ binding . lstat ( pathModule . toNamespacedPath ( path ) , req ) ;
934
935
} ;
935
936
936
937
fs . stat = function ( path , callback ) {
@@ -940,7 +941,7 @@ fs.stat = function(path, callback) {
940
941
if ( ! nullCheck ( path , callback ) ) return ;
941
942
var req = new FSReqWrap ( ) ;
942
943
req . oncomplete = callback ;
943
- binding . stat ( pathModule . _makeLong ( path ) , req ) ;
944
+ binding . stat ( pathModule . toNamespacedPath ( path ) , req ) ;
944
945
} ;
945
946
946
947
fs . fstatSync = function ( fd ) {
@@ -951,14 +952,14 @@ fs.fstatSync = function(fd) {
951
952
fs . lstatSync = function ( path ) {
952
953
handleError ( ( path = getPathFromURL ( path ) ) ) ;
953
954
nullCheck ( path ) ;
954
- binding . lstat ( pathModule . _makeLong ( path ) ) ;
955
+ binding . lstat ( pathModule . toNamespacedPath ( path ) ) ;
955
956
return statsFromValues ( ) ;
956
957
} ;
957
958
958
959
fs . statSync = function ( path ) {
959
960
handleError ( ( path = getPathFromURL ( path ) ) ) ;
960
961
nullCheck ( path ) ;
961
- binding . stat ( pathModule . _makeLong ( path ) ) ;
962
+ binding . stat ( pathModule . toNamespacedPath ( path ) ) ;
962
963
return statsFromValues ( ) ;
963
964
} ;
964
965
@@ -970,14 +971,14 @@ fs.readlink = function(path, options, callback) {
970
971
if ( ! nullCheck ( path , callback ) ) return ;
971
972
var req = new FSReqWrap ( ) ;
972
973
req . oncomplete = callback ;
973
- binding . readlink ( pathModule . _makeLong ( path ) , options . encoding , req ) ;
974
+ binding . readlink ( pathModule . toNamespacedPath ( path ) , options . encoding , req ) ;
974
975
} ;
975
976
976
977
fs . readlinkSync = function ( path , options ) {
977
978
options = getOptions ( options , { } ) ;
978
979
handleError ( ( path = getPathFromURL ( path ) ) ) ;
979
980
nullCheck ( path ) ;
980
- return binding . readlink ( pathModule . _makeLong ( path ) , options . encoding ) ;
981
+ return binding . readlink ( pathModule . toNamespacedPath ( path ) , options . encoding ) ;
981
982
} ;
982
983
983
984
function preprocessSymlinkDestination ( path , type , linkPath ) {
@@ -988,7 +989,7 @@ function preprocessSymlinkDestination(path, type, linkPath) {
988
989
// Junctions paths need to be absolute and \\?\-prefixed.
989
990
// A relative target is relative to the link's parent directory.
990
991
path = pathModule . resolve ( linkPath , '..' , path ) ;
991
- return pathModule . _makeLong ( path ) ;
992
+ return pathModule . toNamespacedPath ( path ) ;
992
993
} else {
993
994
// Windows symlinks don't tolerate forward slashes.
994
995
return ( '' + path ) . replace ( / \/ / g, '\\' ) ;
@@ -1012,7 +1013,7 @@ fs.symlink = function(target, path, type_, callback_) {
1012
1013
req . oncomplete = callback ;
1013
1014
1014
1015
binding . symlink ( preprocessSymlinkDestination ( target , type , path ) ,
1015
- pathModule . _makeLong ( path ) ,
1016
+ pathModule . toNamespacedPath ( path ) ,
1016
1017
type ,
1017
1018
req ) ;
1018
1019
} ;
@@ -1025,7 +1026,7 @@ fs.symlinkSync = function(target, path, type) {
1025
1026
nullCheck ( path ) ;
1026
1027
1027
1028
return binding . symlink ( preprocessSymlinkDestination ( target , type , path ) ,
1028
- pathModule . _makeLong ( path ) ,
1029
+ pathModule . toNamespacedPath ( path ) ,
1029
1030
type ) ;
1030
1031
} ;
1031
1032
@@ -1044,8 +1045,8 @@ fs.link = function(existingPath, newPath, callback) {
1044
1045
var req = new FSReqWrap ( ) ;
1045
1046
req . oncomplete = callback ;
1046
1047
1047
- binding . link ( pathModule . _makeLong ( existingPath ) ,
1048
- pathModule . _makeLong ( newPath ) ,
1048
+ binding . link ( pathModule . toNamespacedPath ( existingPath ) ,
1049
+ pathModule . toNamespacedPath ( newPath ) ,
1049
1050
req ) ;
1050
1051
} ;
1051
1052
@@ -1054,8 +1055,8 @@ fs.linkSync = function(existingPath, newPath) {
1054
1055
handleError ( ( newPath = getPathFromURL ( newPath ) ) ) ;
1055
1056
nullCheck ( existingPath ) ;
1056
1057
nullCheck ( newPath ) ;
1057
- return binding . link ( pathModule . _makeLong ( existingPath ) ,
1058
- pathModule . _makeLong ( newPath ) ) ;
1058
+ return binding . link ( pathModule . toNamespacedPath ( existingPath ) ,
1059
+ pathModule . toNamespacedPath ( newPath ) ) ;
1059
1060
} ;
1060
1061
1061
1062
fs . unlink = function ( path , callback ) {
@@ -1065,13 +1066,13 @@ fs.unlink = function(path, callback) {
1065
1066
if ( ! nullCheck ( path , callback ) ) return ;
1066
1067
var req = new FSReqWrap ( ) ;
1067
1068
req . oncomplete = callback ;
1068
- binding . unlink ( pathModule . _makeLong ( path ) , req ) ;
1069
+ binding . unlink ( pathModule . toNamespacedPath ( path ) , req ) ;
1069
1070
} ;
1070
1071
1071
1072
fs . unlinkSync = function ( path ) {
1072
1073
handleError ( ( path = getPathFromURL ( path ) ) ) ;
1073
1074
nullCheck ( path ) ;
1074
- return binding . unlink ( pathModule . _makeLong ( path ) ) ;
1075
+ return binding . unlink ( pathModule . toNamespacedPath ( path ) ) ;
1075
1076
} ;
1076
1077
1077
1078
fs . fchmod = function ( fd , mode , callback ) {
@@ -1129,15 +1130,15 @@ fs.chmod = function(path, mode, callback) {
1129
1130
if ( ! nullCheck ( path , callback ) ) return ;
1130
1131
var req = new FSReqWrap ( ) ;
1131
1132
req . oncomplete = callback ;
1132
- binding . chmod ( pathModule . _makeLong ( path ) ,
1133
+ binding . chmod ( pathModule . toNamespacedPath ( path ) ,
1133
1134
modeNum ( mode ) ,
1134
1135
req ) ;
1135
1136
} ;
1136
1137
1137
1138
fs . chmodSync = function ( path , mode ) {
1138
1139
handleError ( ( path = getPathFromURL ( path ) ) ) ;
1139
1140
nullCheck ( path ) ;
1140
- return binding . chmod ( pathModule . _makeLong ( path ) , modeNum ( mode ) ) ;
1141
+ return binding . chmod ( pathModule . toNamespacedPath ( path ) , modeNum ( mode ) ) ;
1141
1142
} ;
1142
1143
1143
1144
if ( constants . O_SYMLINK !== undefined ) {
@@ -1175,13 +1176,13 @@ fs.chown = function(path, uid, gid, callback) {
1175
1176
if ( ! nullCheck ( path , callback ) ) return ;
1176
1177
var req = new FSReqWrap ( ) ;
1177
1178
req . oncomplete = callback ;
1178
- binding . chown ( pathModule . _makeLong ( path ) , uid , gid , req ) ;
1179
+ binding . chown ( pathModule . toNamespacedPath ( path ) , uid , gid , req ) ;
1179
1180
} ;
1180
1181
1181
1182
fs . chownSync = function ( path , uid , gid ) {
1182
1183
handleError ( ( path = getPathFromURL ( path ) ) ) ;
1183
1184
nullCheck ( path ) ;
1184
- return binding . chown ( pathModule . _makeLong ( path ) , uid , gid ) ;
1185
+ return binding . chown ( pathModule . toNamespacedPath ( path ) , uid , gid ) ;
1185
1186
} ;
1186
1187
1187
1188
// converts Date or number to a fractional UNIX timestamp
@@ -1216,7 +1217,7 @@ fs.utimes = function(path, atime, mtime, callback) {
1216
1217
if ( ! nullCheck ( path , callback ) ) return ;
1217
1218
var req = new FSReqWrap ( ) ;
1218
1219
req . oncomplete = callback ;
1219
- binding . utimes ( pathModule . _makeLong ( path ) ,
1220
+ binding . utimes ( pathModule . toNamespacedPath ( path ) ,
1220
1221
toUnixTimestamp ( atime ) ,
1221
1222
toUnixTimestamp ( mtime ) ,
1222
1223
req ) ;
@@ -1227,7 +1228,7 @@ fs.utimesSync = function(path, atime, mtime) {
1227
1228
nullCheck ( path ) ;
1228
1229
atime = toUnixTimestamp ( atime ) ;
1229
1230
mtime = toUnixTimestamp ( mtime ) ;
1230
- binding . utimes ( pathModule . _makeLong ( path ) , atime , mtime ) ;
1231
+ binding . utimes ( pathModule . toNamespacedPath ( path ) , atime , mtime ) ;
1231
1232
} ;
1232
1233
1233
1234
fs . futimes = function ( fd , atime , mtime , callback ) {
@@ -1383,7 +1384,7 @@ FSWatcher.prototype.start = function(filename,
1383
1384
encoding ) {
1384
1385
handleError ( ( filename = getPathFromURL ( filename ) ) ) ;
1385
1386
nullCheck ( filename ) ;
1386
- var err = this . _handle . start ( pathModule . _makeLong ( filename ) ,
1387
+ var err = this . _handle . start ( pathModule . toNamespacedPath ( filename ) ,
1387
1388
persistent ,
1388
1389
recursive ,
1389
1390
encoding ) ;
@@ -1472,7 +1473,8 @@ util.inherits(StatWatcher, EventEmitter);
1472
1473
StatWatcher . prototype . start = function ( filename , persistent , interval ) {
1473
1474
handleError ( ( filename = getPathFromURL ( filename ) ) ) ;
1474
1475
nullCheck ( filename ) ;
1475
- this . _handle . start ( pathModule . _makeLong ( filename ) , persistent , interval ) ;
1476
+ this . _handle . start ( pathModule . toNamespacedPath ( filename ) ,
1477
+ persistent , interval ) ;
1476
1478
} ;
1477
1479
1478
1480
@@ -1627,7 +1629,7 @@ fs.realpathSync = function realpathSync(p, options) {
1627
1629
1628
1630
// On windows, check that the root exists. On unix there is no need.
1629
1631
if ( isWindows && ! knownHard [ base ] ) {
1630
- binding . lstat ( pathModule . _makeLong ( base ) ) ;
1632
+ binding . lstat ( pathModule . toNamespacedPath ( base ) ) ;
1631
1633
knownHard [ base ] = true ;
1632
1634
}
1633
1635
@@ -1666,7 +1668,7 @@ fs.realpathSync = function realpathSync(p, options) {
1666
1668
// Use stats array directly to avoid creating an fs.Stats instance just
1667
1669
// for our internal use.
1668
1670
1669
- var baseLong = pathModule . _makeLong ( base ) ;
1671
+ var baseLong = pathModule . toNamespacedPath ( base ) ;
1670
1672
binding . lstat ( baseLong ) ;
1671
1673
1672
1674
if ( ( statValues [ 1 /*mode*/ ] & S_IFMT ) !== S_IFLNK ) {
@@ -1706,7 +1708,7 @@ fs.realpathSync = function realpathSync(p, options) {
1706
1708
1707
1709
// On windows, check that the root exists. On unix there is no need.
1708
1710
if ( isWindows && ! knownHard [ base ] ) {
1709
- binding . lstat ( pathModule . _makeLong ( base ) ) ;
1711
+ binding . lstat ( pathModule . toNamespacedPath ( base ) ) ;
1710
1712
knownHard [ base ] = true ;
1711
1713
}
1712
1714
}
0 commit comments