| 691 | } |
| 692 | |
| 693 | FileRef MountSystem::openFile(const Path& path,File::AccessMode mode) |
| 694 | { |
| 695 | FileNodeRef node = getFileNode(path); |
| 696 | if (node != NULL) |
| 697 | { |
| 698 | FileRef file = dynamic_cast<File*>(node.getPointer()); |
| 699 | if (file != NULL) |
| 700 | { |
| 701 | if (file->open(mode)) |
| 702 | return file; |
| 703 | else |
| 704 | return NULL; |
| 705 | } |
| 706 | } |
| 707 | else |
| 708 | { |
| 709 | if (mode != File::Read) |
| 710 | { |
| 711 | FileRef file = createFile(path); |
| 712 | |
| 713 | if (file != NULL) |
| 714 | { |
| 715 | file->open(mode); |
| 716 | return file; |
| 717 | } |
| 718 | } |
| 719 | } |
| 720 | return NULL; |
| 721 | } |
| 722 | |
| 723 | DirectoryRef MountSystem::openDirectory(const Path& path) |
| 724 | { |
no test coverage detected