mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-06-06 05:08:45 +08:00
open p_mode now also supported on UNIX
This commit is contained in:
@@ -232,7 +232,7 @@ int fileop::open(std::string fn, int& fd, int oflag, int shflag, int pmode) {
|
||||
fd = tmfd;
|
||||
return fd == -1 ? err : 0;
|
||||
#else
|
||||
fd = ::open(fn.c_str(), oflag);
|
||||
fd = ::open(fn.c_str(), oflag, pmode);
|
||||
return fd == -1 ? errno : 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
2
fileop.h
2
fileop.h
@@ -51,7 +51,7 @@ namespace fileop {
|
||||
* @param fd file descriptor. -1 if error occured.
|
||||
* @param oflag The kind of operations allowed.
|
||||
* @param shflag The kind of sharing allowed. (Windows Only)
|
||||
* @param pmode Permission mode. (Windows Only)
|
||||
* @param pmode Permission mode.
|
||||
* @return errno
|
||||
*/
|
||||
int open(std::string fn, int& fd, int oflag, int shflag = 0x10, int pmode = 0);
|
||||
|
||||
Reference in New Issue
Block a user