从phantomJs渲染的文件名的字符数有没有限制?
var page = require('webpage').create();
page.open('http://github.com/', function() {
window.setTimeout(function(){
var filename = encodeURI('The code shown here is also available in various examples included with PhantomJS. You are also recommended to explore the use of PhantomJS for page automation, network monitoring, screen capture, and headless testing The code shown here is also available in various examples included with PhantomJS. You are also recommended to explore the use of PhantomJS for page automation, network monitoring, screen capture, and headless testing');
console.log('filename: ' + filename);
page.render(filename + ".png");
phantom.exit();}, 100);
});此文件不是通过phantomJs呈现的。
有人能帮帮忙吗?
发布于 2017-12-05 22:33:40
我不认为这与PhantomJS有任何关系,但基本上是与你的操作系统有关。在每个操作系统中,文件路径名都有大小限制。
根据naming convention in Windos OS的说法-
在Windows API中(以下段落讨论的一些例外情况除外),路径的最大长度为MAX_PATH,定义为260个字符。本地路径按以下顺序构成:驱动器号、冒号、反斜杠、由反斜杠分隔的名称组件和终止空字符。例如,驱动器D上的最大路径是“D:\某个256个字符的路径字符串”,其中"“表示当前系统代码页的不可见的终止空字符。(这里使用的字符<>是为了清晰起见,不能是有效路径字符串的一部分。)
https://stackoverflow.com/questions/46155260
复制相似问题