aboutsummaryrefslogtreecommitdiff
path: root/common/macresman.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/macresman.cpp')
-rw-r--r--common/macresman.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/common/macresman.cpp b/common/macresman.cpp
index 70c6e0a7ce..c1cab8b96a 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -32,7 +32,6 @@
#ifdef MACOSX
#include "common/config-manager.h"
-#include "backends/fs/stdiostream.h"
#endif
namespace Common {
@@ -108,14 +107,17 @@ bool MacResManager::open(String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = ConfMan.get("path") + "/" + filename + "/..namedfork/rsrc";
- SeekableReadStream *macResForkRawStream = StdioStream::makeFromPath(fullPath, false);
+ FSNode resFsNode = FSNode(fullPath);
+ if (resFsNode.exists()) {
+ SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
- if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
- _baseFileName = filename;
- return true;
- }
+ if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
+ _baseFileName = filename;
+ return true;
+ }
- delete macResForkRawStream;
+ delete macResForkRawStream;
+ }
#endif
File *file = new File();
@@ -168,14 +170,17 @@ bool MacResManager::open(FSNode path, String filename) {
#ifdef MACOSX
// Check the actual fork on a Mac computer
String fullPath = path.getPath() + "/" + filename + "/..namedfork/rsrc";
- SeekableReadStream *macResForkRawStream = StdioStream::makeFromPath(fullPath, false);
+ FSNode resFsNode = FSNode(fullPath);
+ if (resFsNode.exists()) {
+ SeekableReadStream *macResForkRawStream = resFsNode.createReadStream();;
- if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
- _baseFileName = filename;
- return true;
- }
+ if (macResForkRawStream && loadFromRawFork(*macResForkRawStream)) {
+ _baseFileName = filename;
+ return true;
+ }
- delete macResForkRawStream;
+ delete macResForkRawStream;
+ }
#endif
// First, let's try to see if the Mac converted name exists