Linux
weixin_39566143
这个作者很懒,什么都没留下…
展开
-
unix realpath函数实现代码
//// Created by xia on 2022/4/5.//#include <libgen.h>#include "tlpi_hdr.h"#include <fcntl.h>#include <sys/types.h>#include <sys/stat.h>#include <dirent.h>char *my_realpath(const char *path, char *resolved_path){原创 2022-04-06 11:51:18 · 507 阅读 · 0 评论 -
模仿unix tail程序的源代码,只支持 -n 指定行数
//// Created by xia on 2022/3/16.//#include "common.h"int main(int argc,char *argv[]){ if(argc <2 || strcmp(argv[1],"--help")==0) errExit("%s [-n lines] file",argv[0]); int opt,n=10; while ((opt = getopt(argc,argv,"n:")) != -1原创 2022-03-16 20:51:41 · 300 阅读 · 0 评论 -
liunx下使用管道传输cv::Mat图像数据 c++
代码只供参考,在实际的使用场景中,进程之间可以传送不同的图片数据,比如一个进程负责读取相机传过来的数据,(网络相机可能会有很大的延迟,所以另开进程读取数据)另一个进程负责把图片输入到神经网络模型中去。//// Created by xia on 2022/1/5.//#include "unistd.h"#include "cstdlib"#include "cstdio"#include "cstring"#include "sys/wait.h"#include "opencv2/h原创 2022-01-05 21:58:01 · 866 阅读 · 0 评论