摘要: ls.c ```c#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <fcntl.h>#incl 阅读全文
posted @ 2022-05-14 15:46 孤走 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 点灯代码 本次代码基于野火的代码,使用STM32cubeMX生成,移植野火写的代码,也参考了小蜜蜂笔记(这是很好的入门) 下面是移植的代码 .c文件没有啥,主要是.h文件,一般都宏定义好的 这是.c文件 #include "bsp_led_HAL.h" /** * @brief 自由函数 * @pa 阅读全文
posted @ 2022-05-09 23:33 孤走 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 先了解下面的这几个结构体 以下三个函数可以获取文件/目录的属性信息:#include <unistd.h>#include <sys/types.h>#include <sys/stat.h> int stat(const char *path, struct stat *buf);//如果文件是符 阅读全文
posted @ 2022-05-07 19:20 孤走 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 第一方法: #include <time.h> time_t time(time_t *tloc); 功能:计算从1970年1月1日0时0分0秒 到 此时此刻的秒数 参数:保存秒数的变量地址在这里插入代码片 返回值:成功:返回获取的秒数 失败:-1 ctime() #include<stdio.h> 阅读全文
posted @ 2022-05-07 14:45 孤走 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 例如: #include <stdio.h> #include <stdlib.h> #include <string.h> //指针函数 一个函数,它的返回值是指针 char * fun1(void) { char p[] = "hello world"; return p; //不能返回栈中的地 阅读全文
posted @ 2022-04-20 20:52 孤走 阅读(52) 评论(0) 推荐(0) 编辑
摘要: sudo vim /etc/sudoers //修改用户权限 sudo vim /etc/passwd //修改用户密码 sudo vim /etc/shadow //修改用户密码的信息 sudo userdel wwww //删除用户 cd /home ls sudo rm -r wwww //删 阅读全文
posted @ 2022-04-20 20:09 孤走 阅读(293) 评论(0) 推荐(0) 编辑