C language umask () function:set the permission mask when creating a new fileHeader file:
Define the function:
mode_t umask (mode_t mask);
Function description:umask () sets the system umask value to the value after the parameter mask&0777, and then returns the previous umask value. When using open () to create a new file, The parameter mode is not the permission to actually create the file, It is the (mode&~ umask) permission value.
When creating a file, specify file permissions as 0666, usually the umask value defaults to 022, then the true permissions of the file are 0666&022=0644, which is rw-r--r--return value. This call will have no error return. The return value is the umask value of the previous system.
c language truncate () function:change file sizeHeader file:
Define the function:
int truncate (const char * path, off_t length);
Function description:truncate () will change the file size specified by the parameter path to the size specified by the length parameter. If the original file size is larger than the length parameter, the excess will be deleted.
Return value:0 for successful execution, -1 for failure, and the cause of the error is stored in errno.
1. The file specified by the eaccess parameter path cannot be accessed.
2. Erofs The file to be written exists in the read-only file system.
3. The efault parameter path pointer exceeds the accessible memory space.
4. The einval parameter path contains illegal characters.
5. The enametoolong parameter path is too long.
6, enotdir parameter path path is not a directory.
7. The eisdir parameter path points to a directory.
8.The file pointed to by etxtbusy parameter path is a shared program. And it is being implemented.
9. The eloop parameter path has too many symbolic link problems.
10. eio i/o access error.
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- xcode - pod install [!] no `podfile 'found in the project directory
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file