blob: d0945f1e518e420c000d0ed45687ad5cf2e1d4a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
'use strict';
var common = require('../common');
var fs = require('fs');
var path = require('path');
var assert = require('assert');
if (!common.isWindows) {
common.skip('this test is Windows-specific.');
return;
}
var successes = 0;
// make a path that will be at least 260 chars long.
var fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x'));
var fullPath = path.resolve(fileName);
common.refreshTmpDir();
console.log({
filenameLength: fileName.length,
fullPathLength: fullPath.length
});
fs.writeFile(fullPath, 'ok', function(err) {
if (err) throw err;
successes++;
fs.stat(fullPath, function(err, stats) {
if (err) throw err;
successes++;
});
});
process.on('exit', function() {
fs.unlinkSync(fullPath);
assert.equal(2, successes);
});
|