|
|
|
Lines 642-660
exports.closeSync = closeSync;
|
Link Here
|
|---|
|
| 642 |
* given to the completion callback. |
642 |
* given to the completion callback. |
| 643 |
*/ |
643 |
*/ |
| 644 |
let close = Async(closeSync); |
644 |
let close = Async(closeSync); |
| 645 |
exports.close = close; |
645 |
exports.close = close; |
| 646 |
|
646 |
|
| 647 |
/** |
647 |
/** |
| 648 |
* Synchronous open(2). |
648 |
* Synchronous open(2). |
| 649 |
*/ |
649 |
*/ |
| 650 |
function openSync(path, flags, mode) { |
650 |
function openSync(path, flags_, mode_) { |
| 651 |
let [ fd, flags, mode, file ] = |
651 |
let [ fd, flags, mode, file ] = |
| 652 |
[ { path: path }, Flags(flags), Mode(mode), nsILocalFile(path) ]; |
652 |
[ { path: path }, Flags(flags_), Mode(mode_), nsILocalFile(path) ]; |
| 653 |
|
653 |
|
| 654 |
nsIFile(fd, file); |
654 |
nsIFile(fd, file); |
| 655 |
|
655 |
|
| 656 |
// If trying to open file for just read that does not exists |
656 |
// If trying to open file for just read that does not exists |
| 657 |
// need to throw exception as node does. |
657 |
// need to throw exception as node does. |
| 658 |
if (!file.exists() && !isWritable(flags)) |
658 |
if (!file.exists() && !isWritable(flags)) |
| 659 |
throw FSError("open", "ENOENT", 34, path); |
659 |
throw FSError("open", "ENOENT", 34, path); |
| 660 |
|
660 |
|