随笔分类 - 23_编码
摘要:POSIX标准定义的必须的头文件(26项)<fcntl.h> 文件控制<sys/types.h> 基本系统数据类型(很多类型其实都是用typedef重定义的,和基本类型没什么区别;只是为了定义pid_t,size_t,没别的意思)<sys/stat.h> 文件状态<unistd.h> 符号常量(un
阅读全文
摘要:用python3实现批量将文件的编码格式进行转换; 需要指定四个参数, 1、搜索的根路径 2、文件的类型(正则表达式来处理) 3、源编码格式 4、目标编码格式 #!/usr/bin/env python # -*- coding: utf-8 -*- import os import codecs
阅读全文
摘要:在指定目录下,模糊匹配搜寻目标文件,并得出目标文件的完整路径; 采用match完全匹配; #!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import ctypes import re if __name__=="
阅读全文
摘要:C语言版: 参考链接:https://blog.csdn.net/a_ran/article/details/40897159 cal_md5.c #include "md5.h" #include <stdio.h> #include <stdlib.h> #include <string.h>
阅读全文
摘要:通过stat函数获取文件的大小,单位bytes;无需将文件读入内存,可以计算大文件; #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <stdio.h> int stat(const char *pa
阅读全文

浙公网安备 33010602011771号