newfile()
#
newfile()
creates a new file with the specified permissions, optionally overwriting an existing file.
Prototype
int newfile(
const char *path,
int permission,
BOOL overwrite
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The file path to create. |
|
|
The file permission mode (e.g., 0660). |
|
|
If |
Return Value
Returns a file descriptor on success, or -1
on failure.
Notes
This function sets umask(0)
to ensure the specified permissions are applied.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples