码迷,mamicode.com
首页 >  
搜索关键字:fcntl    ( 291个结果
文件目录相关函数
//-rw-rw-r-- 2 zijiao zijiao 16 Feb 24 13:20 hello #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl ...
分类:其他好文   时间:2020-02-29 17:33:44    阅读次数:71
文件IO其二
1.文件IO 文件IO属于linux系统中关于文件操作的系统调用,对于文件的操作也是跟标准IO一样,打开文件 > 操作文件 > 关闭文件。 文件IO和标准IO的比较: 标准IO 文件IO 代表打开的文件 文件流指针(FILE*) 文件描述符(fd) 打开文件/关闭文件 fopen/fclose op ...
分类:其他好文   时间:2020-02-29 00:47:01    阅读次数:95
通过/dev/mem操作物理内存
/dev/mem设备可以用来访问物理内存。下面一段应用程序的代码,实现了通过/dev/mem对物理内存空间中SRAM1的访问。 #include <stdio.h> #include <stdint.h> #include <fcntl.h> #include <unistd.h> #include ...
分类:其他好文   时间:2020-02-23 16:31:38    阅读次数:209
IPC通信_无名管道(PIPE)
无名管道只能在具有公共祖先的两个进程间使用,且建议半双工使用(因为历史上就是半双工,虽然有些系统支持全双工管道)。 无名管道通过pipe函数创建 #include <unistd.h> int pipe(int fd[2]); 其中:参数fd返回两个文件描述符,fd[0]只用来读,是输出,fd[1] ...
分类:其他好文   时间:2020-02-02 23:45:57    阅读次数:91
IPC通信_有名管道(FIFO)
与无名管道不同,有名管道FIFO可以在两个无关进程间使用。 #include <sys/stat.h> int mkfifo(const char* path, mode_t mode); 上述函数用于生成一个FIFO文件,其中的mode参数与open函数中的mode相同。当创建了FIFO文件后,要 ...
分类:其他好文   时间:2020-02-02 23:35:09    阅读次数:81
Python 3.9.0 首个迭代版本发布了
Python 3.9.0 alpha 1 发布了,这是 3.8 之后的首个 3.9 系列版本。 ! 官方没有介绍新特性,也没有添加新模块,但是以下模块有所改进: ast asyncio curses fcntl os threading venv pathlib pprint importlib s ...
分类:编程语言   时间:2020-01-20 14:49:30    阅读次数:82
linux下C语言文件操作相关函数
读取(open)文件并写入(write)另一个文件 #include <stdio.h> #include<stdlib.h> #include<string.h> #include<fcntl.h>.h> int main() { int fd1=open("/home/cpc/Documents ...
分类:编程语言   时间:2020-01-06 09:38:59    阅读次数:195
UNIX环境高级编程APUE练习3.2-不用fcntl实现dup2的功能
UNIX环境高级编程APUE练习3.2。编写与dup2功能相同的函数,要求不调用fcntl函数,并且要有正确的出错处理。 ...
分类:其他好文   时间:2019-12-17 20:19:25    阅读次数:76
Python 标准库之 fcntl
在 linux 环境下用 Python 进行项目开发过程中经常会遇到多个进程对同一个文件进行读写问题,而此时就要对文件进行加锁控制,在 Python 的 linux 版本下有个 fcntl 模块可以方便的对文件进行加、解锁控制。 import fcntl file_path = "/home/ubu ...
分类:编程语言   时间:2019-12-14 19:01:35    阅读次数:114
C实现Linux中copy功能
/* mycp.c */ #include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<fcntl.h> #include<string.h> #include<dirent.h> #include<sys/types.h> #in ...
分类:系统相关   时间:2019-11-27 19:20:06    阅读次数:106
291条   上一页 1 2 3 4 5 ... 30 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!