mirror of
https://github.com/ksherlock/mpw.git
synced 2025-02-16 12:30:53 +00:00
create resource fork if opening w/ write permission
This commit is contained in:
parent
d52dab0235
commit
78ebd808d4
@ -203,9 +203,11 @@ namespace native {
|
||||
|
||||
|
||||
int open_resource_fork(const std::string &path_name, int oflag) {
|
||||
|
||||
// should create if it doesn't exist...
|
||||
if ((oflag & O_ACCMODE) & O_WRONLY) oflag |= O_CREAT;
|
||||
/* under HFS, every file has a resource fork.
|
||||
* Therefore, create it if opening for O_RDWR or O_WRONLY
|
||||
*/
|
||||
int mode = oflag & O_ACCMODE;
|
||||
if (mode == O_WRONLY || mode == O_RDWR) oflag |= O_CREAT;
|
||||
return attropen(path_name.c_str(), XATTR_RESOURCEFORK_NAME, oflag, 0666);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user