From 2fe090b7f6026d6b2a05f484f7e3c994d1892842 Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 26 May 2009 03:37:18 +0200 Subject: [PATCH] Add node.fs prefix to some constants. oops. --- src/file.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/file.js b/src/file.js index 66879b26f2a..6e0cead1c44 100644 --- a/src/file.js +++ b/src/file.js @@ -100,31 +100,31 @@ node.fs.File = function (options) { var internal_methods = { open: function (path, mode) { - var m = node.fs.O_RDONLY; + var flags; switch (mode) { case "r": - m = node.fs.O_RDONLY; + flags = node.fs.O_RDONLY; break; case "r+": - m = node.fs.O_RDWR; + flags = node.fs.O_RDWR; break; case "w": - m = O_CREAT | O_TRUNC | O_WRONLY; + flags = node.fs.O_CREAT | node.fs.O_TRUNC | node.fs.O_WRONLY; break; case "w+": - m = O_CREAT | O_TRUNC | O_RDWR; + flags = node.fs.O_CREAT | node.fs.O_TRUNC | node.fs.O_RDWR; break; case "a": - m = O_APPEND | O_CREAT | O_WRONLY; + flags = node.fs.O_APPEND | node.fs.O_CREAT | node.fs.O_WRONLY; break; case "a+": - m = O_APPEND | O_CREAT | O_RDWR; + flags = node.fs.O_APPEND | node.fs.O_CREAT | node.fs.O_RDWR; break; default: throw "Unknown mode"; } - - node.fs.open(path, m, 0666, function (status, fd) { + // fix the mode here + node.fs.open(path, flags, 0666, function (status, fd) { self.fd = fd; poll(status, fd); });