mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-21 09:30:55 +00:00
APFS - when opening a resource fork as rdwr, create it as well
-- Under HFS, empty resource fork always exists. on APFS, it must be specifically created.
This commit is contained in:
parent
60b49a1ff4
commit
119d9aab57
@ -548,12 +548,21 @@ namespace OS { namespace Internal {
|
||||
}
|
||||
|
||||
std::string xname = filename;
|
||||
if (fork)
|
||||
if (fork) {
|
||||
xname.append(_PATH_RSRCFORKSPEC);
|
||||
// O_RDWR should also O_CREAT
|
||||
}
|
||||
|
||||
Log(" open(%s, %04x)\n", xname.c_str(), access);
|
||||
|
||||
fd = ::open(xname.c_str(), access);
|
||||
|
||||
if (fd < 0 && access == O_RDWR && errno == ENOENT && fork)
|
||||
{
|
||||
fd = ::open(xname.c_str(), O_RDWR | O_CREAT, 0666);
|
||||
}
|
||||
|
||||
|
||||
if (fd < 0 && ioPermission == fsCurPerm && errno == EACCES)
|
||||
{
|
||||
fd = ::open(xname.c_str(), O_RDONLY);
|
||||
|
Loading…
Reference in New Issue
Block a user