2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2011-12-05 06:37:18 +01:00
|
|
|
var common = require('../common');
|
2011-11-25 09:29:06 +01:00
|
|
|
var fs = require('fs');
|
|
|
|
var path = require('path');
|
|
|
|
var assert = require('assert');
|
|
|
|
|
2015-12-02 18:13:27 +01:00
|
|
|
if (!common.isWindows) {
|
|
|
|
console.log('1..0 # Skipped: this test is Windows-specific.');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-11-25 09:29:06 +01:00
|
|
|
var successes = 0;
|
|
|
|
|
|
|
|
// make a path that will be at least 260 chars long.
|
2011-12-05 06:37:18 +01:00
|
|
|
var fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
|
|
|
|
var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x'));
|
2011-11-25 09:29:06 +01:00
|
|
|
var fullPath = path.resolve(fileName);
|
|
|
|
|
2015-06-09 11:40:55 -07:00
|
|
|
common.refreshTmpDir();
|
2013-03-02 02:43:01 +01:00
|
|
|
|
2012-01-17 19:43:34 +01:00
|
|
|
console.log({
|
|
|
|
filenameLength: fileName.length,
|
|
|
|
fullPathLength: fullPath.length
|
|
|
|
});
|
2011-11-25 09:29:06 +01:00
|
|
|
|
|
|
|
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() {
|
2013-02-28 09:18:12 -08:00
|
|
|
fs.unlinkSync(fullPath);
|
2011-11-25 09:29:06 +01:00
|
|
|
assert.equal(2, successes);
|
|
|
|
});
|