mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-22 00:32:44 +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;
|
std::string xname = filename;
|
||||||
if (fork)
|
if (fork) {
|
||||||
xname.append(_PATH_RSRCFORKSPEC);
|
xname.append(_PATH_RSRCFORKSPEC);
|
||||||
|
// O_RDWR should also O_CREAT
|
||||||
|
}
|
||||||
|
|
||||||
Log(" open(%s, %04x)\n", xname.c_str(), access);
|
Log(" open(%s, %04x)\n", xname.c_str(), access);
|
||||||
|
|
||||||
fd = ::open(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)
|
if (fd < 0 && ioPermission == fsCurPerm && errno == EACCES)
|
||||||
{
|
{
|
||||||
fd = ::open(xname.c_str(), O_RDONLY);
|
fd = ::open(xname.c_str(), O_RDONLY);
|
||||||
|
Loading…
Reference in New Issue
Block a user