1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 04:27:59 +01:00

Add IO#File.

New review:
owner: dougkearns
I like this for the most part, except that it has to go to lengths
to wrap the original nsIFile correctly, an that it can't be passed
directly to other XPCOM components. It makes most operations on
files a lot cleaner, though.
This commit is contained in:
Kris Maglione
2009-10-31 17:40:16 -04:00
parent d880d4afcb
commit 7a9889b18c
9 changed files with 244 additions and 232 deletions

View File

@@ -181,7 +181,7 @@ function Buffer() //{{{
function openUploadPrompt(elem)
{
commandline.input("Upload file: ", function (path) {
let file = io.getFile(path);
let file = io.File(path);
if (!file.exists())
return void liberator.beep();
@@ -541,7 +541,7 @@ function Buffer() //{{{
if (arg)
{
options.setPref("print.print_to_file", "true");
options.setPref("print.print_to_filename", io.getFile(arg.substr(1)).path);
options.setPref("print.print_to_filename", io.File(arg.substr(1)).path);
liberator.echomsg("Printing to file: " + arg.substr(1));
}
else
@@ -617,7 +617,7 @@ function Buffer() //{{{
if (filename)
{
let file = io.getFile(filename);
let file = io.File(filename);
if (file.exists() && !args.bang)
return void liberator.echoerr("E13: File exists (add ! to override)");