C/C++ 实现自己的文件系统-WinFsp

实现:将一个文件映射成一个虚拟的文件系统。

 


int wmain(int argc, wchar_t** argv)
{
    if (!NT_SUCCESS(FspLoad(0)))
        return ERROR_DELAY_LOAD_FAILED;
    printf("开始启动系统。。。。。\n");
 
    HANDLE hThread = CreateThread(NULL, 0, Fun, NULL, 0, NULL);
    Sleep(1000);
 
    if (!NT_SUCCESS(Result))
    {
        printf("文件系统启动失败\n");
        return 0;
    }
 
    //while (true)
    //{
    //    cout << "[" << "filesystem" << "]$ :";
    static char usage[] = ""
        "usage: %s OPTIONS\n"
        "\n"
        "options:\n"
        "    ls     查看文件列表 \n"
        "    cd     进入文件夹 \n"
        "    mkdir   创建文件夹 \n"
        "    touch   创建文件  touch hello.txt \n"
        "    read   读文件  read hello.txt \n"
        "    write  写文件  write hello.txt   helloword \n"
        "    aes   加密/解密文件  encrypt/decrypt hello.txt \n"
        "    rm   删除文件  rm hello.txt\n"
        "    rname   重命名文件 rname hello.txt hello2.txt \n"
        "    stat   获取文件信息 stat hello.txt \n"
        "    info   获取卷信息 \n"
        "    exit   退出系统 \n"
        "   \n"
       ;
    
    printf(usage, "" PROGNAME);


    cmd_in_parse();
   
    printf("\n");
    printf("退出文件系统。。。。。");
    return 0;
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值