mirror of https://github.com/vitalif/phantomjs
Use fs.write in the example for clarity.
https://code.google.com/p/phantomjs/issues/detail?id=10821.9
parent
04368c6af8
commit
ca27a8eab1
|
@ -13,8 +13,7 @@ else
|
|||
content += system.args[i] + (if i == system.args.length - 1 then "" else " ")
|
||||
++i
|
||||
try
|
||||
f = fs.open(system.args[1], "w")
|
||||
f.writeLine content
|
||||
fs.write system.args[1], content, "w"
|
||||
catch e
|
||||
console.log e
|
||||
phantom.exit()
|
||||
|
|
|
@ -14,10 +14,8 @@ if (system.args.length < 3) {
|
|||
}
|
||||
|
||||
try {
|
||||
f = fs.open(system.args[1], "w");
|
||||
f.writeLine(content);
|
||||
f.close();
|
||||
} catch (e) {
|
||||
fs.write(system.args[1], content, 'w');
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue