【我的Rust库】get_local_info 0.1.9发布

0.1.6、0.17版发布三天,累计阅读量超过一千。感谢大家的喜欢,我的运气真好。

今天发布0.1.9版,原因是0.1.8让我把版本号写错了。哈哈

0.1.9 增加目录遍历

get_local_info是一个获取linux本地信息的Rust三方库,其目标是降低获取本地linux系统信息的难度。支持银河麒麟10、UOS、鸿蒙等国产系统。

项目维护:长期

当前功能:

1.网络功能

1.1获取活动网卡信息:网卡,IPv4,IPv6,mac

1.2.获取网络接口信息

2.获取系统版本

Kylin10支持2017及以上版本

Ubuntu支持22.04及以上版本

UOS20支持1020及以上版本

3.进程检测,虚拟机检测,双系统检测

4.信息安全检测

获取天融信反病毒库时间

5.文件信息

得到指定目录下所有文件名

怎么使用:

执行cargo add get_local_info,然后导入调用接口:

rust 复制代码
extern crate get_local_info;

fn main() {
    println!("{}", get_local_info::get_pc_net_card_name());
    println!("{}", get_local_info::get_pc_ipv4());
    println!("{}", get_local_info::get_pc_ipv6());
    println!("{}", get_local_info::get_pc_mac());
    println!("{:?}", get_local_info::get_pc_net_card_info());
    // osname: ubuntu or uos or kylin
    let osname = "uos";
    println!("{}", get_local_info::get_pc_system_ver(osname));
    //check proccess name
    let pname = "gnome";
    println!("{}", get_local_info::get_pc_system_check_pname(pname));
    // flase is Real machine, true is vm
    println!("Running in VM:{}", get_local_info::get_pc_system_is_vm());
     // true is multi os
    println!("multi os:{}", get_local_info::get_pc_system_is_d_sys());
    // Obtain the update time of the antivirus database
    let antiname = "topsec";
    println!("{}", get_local_info::get_pc_check_antiviruslib(antiname));
    //Traverse all files in the specified directory
    let idir = "/home/test/rust1";
    println!("{:?}", get_local_info::get_dir_filename(idir));
}

关于作者:

* Liu Qiang in Wuhan, China

* crates: <https://crates.io/crates/get_local_info\>

* github: <https://github.com/daijianshusheng/rs_libGetDeviceInfo\>

* mail: <liulcsy@qq.com>

* Created on 2023.12.28

相关推荐
斑鸠喳喳5 分钟前
模块系统 JPMS
java·后端
kunge20137 分钟前
【手写数字识别】之数据处理
后端
苦逼的老王8 分钟前
java之uniapp实现门店地图
java·开发语言·uni-app
SimonKing9 分钟前
Redis7系列:百万数据级Redis Search 吊打 ElasticSearch
后端
uhakadotcom11 分钟前
Python应用中的CI/CD最佳实践:提高效率与质量
后端·面试·github
一条晒干的咸魚13 分钟前
【C#学习笔记03】进制转换与反码、补码、原码
开发语言·笔记·学习·c#
火车叼位27 分钟前
命令`ls **/*.exe`遗漏本目录下文件?Bash的globstar配置了解一下
linux·shell
十年之少39 分钟前
内存检测工具——Qt Creator
开发语言·qt
嵌入式-老费1 小时前
Linux上位机开发实战(x86和arm自由切换)
linux·运维·arm开发