c - 如何检查 C tiny c 编译器中是否存在文件
问题描述
我使用的是微型 c 编译器,当我尝试运行我的程序时遇到问题,我收到消息“未找到包含文件‘unistd.h’”
#include<unistd.h>
#include<stdio.h>
int main()
{
char openfile[100];
char entercommand[100];
scanf("%s",entercommand);
if(entercommand == "cat.exe")
{
printf("please enter the name of the file : \n");
}
scanf("%s",openfile);
if(access(openfile,F_OK) != -1)
{
printf("the file exists \n");
}
else
{
printf("the file does not exist \n");
}
return 0;
}
解决方案
推荐阅读
- azure-storage - Azure Function App 中用户计算机上给定路径的图像流/字节数组
- qt - 如何更改 Qt VitrualKeyboard InputPanel 布局?
- elasticsearch - elasticsearch java api中的指数提升
- sql - 在主查询中使用子查询结果
- c# - 映射xml文件,然后导入xmls文件c#
- c# - 在 Razor Pages 应用程序中使用 Web API JWT 身份验证
- php - 在 Composer 自动加载中定义加载类的顺序
- python - 填写缺失数据并与主集合并
- sql-server - 无法从 VS2017 执行 SSIS 包
- android - 已为元素“android.support.v7.widget.CardView”指定了 logcat 属性“xmlns:card_view”上的 Android Studio 错误