当前位置:网站首页>System file interface open
System file interface open
2022-06-13 05:00:00 【Clown clown clown】
System file interface open Introduce
man Manual introduction 
Parameters 1: File pathname , Generally, the current path is opened , Enter the file name directly
a key :
Parameters 2:flags – Indicates how you want to open , There are several commonly used
O_TRUNC --- Empty files open truncated
O_WRONLY --- Just write open open write only
O_RDONLY --- Read only open open read only
O_APPEND --- Append open open append
O_CREAT --- If the file does not exist , Create a new
notes : The options and c The options given by language are different ,c Linguistic w The option is to clear and then write ,a The option is to append , It's not here .
The additional write here should include O_WRONLY and O_APPEND
The clear write here should contain O_TRUNC and O_WRONLY
Use... Between options | separate .
Like this :
reason : We can have a look at linux How the kernel defines open flags Of 
You can find , The kernel is implemented with bit segments flags Of .
in other words , every last bit Each bit represents a permission .os See what permissions are opened , Just look flag The number of this variable bit Is it 1 that will do 
Parameters 3:mode. If you choose O_CREAT Option and actually created a file , that mode This is the initial permission of this file .
such as :0644 namely rw-r–r--
边栏推荐
- String()和toString()方法得区别
- Gradient descent, learning rate
- shell变量学习笔记
- 2021TPAMI/图像处理:Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
- 利用Javeswingjdbc基于mvc设计系统
- Sub paragraph of Chapter 16
- BM1Z002FJ-EVK-001开机测评
- Simple-SR:Best-Buddy GANs for Highly Detailed Image Super-Resolution論文淺析
- Configuration used by automatic teaching evaluation script
- Four methods for judging JS data types and user-defined methods
猜你喜欢

Embedded hardware - read schematic

Optocoupler working principle function electric parameter application circuit

The differences between the four startup modes of activity and the applicable scenarios and the setting methods of the two startup modes

Conception d'un système basé sur MVC avec javaswing JDBC

External sort

Design system based on MVC using javeswingjdbc

PostgreSQL Guide: inside exploration (Chapter 10 basic backup and point in time recovery) - Notes

Section 7 - structures

Sort (internal sort) + external sort

Section 5 - Operator details
随机推荐
SQL notes
Simple SR: best buddy Gans for highly detailed image super resolution
Cesium:cesiumlab makes image slices and loads slices
rainbow
C language learning log 1.16
C language learning log 1.22
语音信号分帧的理解
metaRTC4.0稳定版发布
Common skills in embedded programming
Clause 47: please use traits classes to represent type information
Hidden implementation and decoupling, knowing Pimpl mode
String()和toString()方法得区别
MySQL8.0.13安装教程(有图)
C language learning log 1.17
shell变量学习笔记
Section 6 - pointers
Force buckle 25 A group of K flipped linked lists
What is the difference between ROM, ram and flash? SRAM、DRAM、PROM、EPROM、EEPROM
PostgreSQL Guide: Insider exploration (Chapter 7 heap tuples and index only scanning) - Notes
[LeetCode]-滑动窗口