0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00

Add node.fs prefix to some constants. oops.

This commit is contained in:
Ryan 2009-05-26 03:37:18 +02:00
parent d1b0ce6d37
commit 2fe090b7f6

View File

@ -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);
});