当前位置: 首页 > news >正文

做个网站多钱关键词密度查询站长工具

做个网站多钱,关键词密度查询站长工具,浦口区网站建设售后保障,网站开发费应该入什么科目👍作者主页:进击的1 🤩 专栏链接:【1的Linux】 文章目录 一,初识文件二,文件接口 一,初识文件 文件就是文件内容属性。因此对文件的操作无非就是对文件内容的操作和对文件属性的操作。 我们访问…

👍作者主页:进击的1++
🤩 专栏链接:【1++的Linux】

文章目录

  • 一,初识文件
  • 二,文件接口

一,初识文件

文件就是文件内容+属性。因此对文件的操作无非就是对文件内容的操作和对文件属性的操作。
我们访问文件,都是经过代码–>编译–>运行–>访问文件。这样的步骤。也就是说访问文件本质是进程在进行访问。
文件都是在硬件中放着,向硬件中访问与写入,只有操作系统才有这样的权力。我们普通用户也想写入,只有通过OS提供的接口来进行写入。
我们想想在语言级别中我们是如何对文件进行访问与写入的?------都是通过封装的文件相关的函数就行操作,那为什么不知直接用系统相关的调用函数呢?
原因有如下两点;

  1. 不同OS的系统调用函数不同,如果我们在代码中直接用了某个OS提供的系统调用函数,那么在其他OS下,该代码将会出现错误。因此使用经过语言提供的文件操作函数,可以跨平台。跨平台的方法可以将所有平台的代码都实现一遍,然后经过条件编译,动态裁剪,从而拿到我们当前需要的代码。
  2. 系统调用接口是更为复杂的,因此语言级别的接口都会进行封装,使其更好用。

Linux下一切皆文件。
我们对文件的操作无非就是read/write 。站到进程的角度我们使用printf,打印东西到屏幕上就是一种写:将数据写到屏幕上;使用scanf,进行输入,就是一种读,从键盘中读取数据到变量中。
因此实际上显示器和键盘也是文件。
因此我们可以再来一个小总结:什么是文件呢?

站在系统的角度,能够被写入,或是被读取的 设备就叫文件。狭义来说:就是我们的磁盘文件。广义来说:我们的显示器,键盘,网卡等都是文件。

二,文件接口

#include<stdio.h>
#include<string.h>
int main()
{FILE* fd=fopen("test.txt","w+");fprintf(fd,"zkn\n");char tmp[20];rewind(fd);fscanf(fd,"%s",tmp);fclose(fd);printf("%s\n",tmp);return 0;
}
#include<stdio.h>
int main()
{FILE* fd=fopen("test.txt","w+");char name[]={"zkn\n"};fwrite(name,sizeof(char),sizeof(name),fd);char tmp[10];rewind(fd);//文件写入后再读的话需要将文件内部的位置指针指向开头。fread(tmp,sizeof(char),sizeof(tmp),fd);printf("%s",tmp);fclose(fd);return 0;
}

以上是我们在C语言中常用的文件操作。
下面展示系统的文件操作接口:

打开文件
在这里插入图片描述
在这里插入图片描述
其中flags代表的是打开的方式,mode代表若文件不存在,新创建文件的权限。
下面我们来详细说说flags。

flags为整型,但是实际上我们不能以整型去看待它,而是把它看作位图。也就是说它的每一位都代表了一种选择。
有如下例子:

#include<stdio.h>
#define ONE 0x1
#define TWO 0x2
#define THREE 0x3void show(int flags)
{if(flags& ONE) printf("one\n");if(flags& TWO) printf("two\n");if(flags& THREE) printf("three\n");}
int main()
{show(ONE);printf("--------------------\n");show(ONE|TWO);printf("--------------------\n");show(ONE|TWO|THREE);return 0;
}

在这里插入图片描述
通过上述例子我们就能清楚的了解到flags的用法了。

写文件:

在这里插入图片描述

读文件

在这里插入图片描述
下面是系统文件调用接口的演示:

#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<string.h>
int main()
{// int fd=open("test.txt",O_RDONLY|O_WRONLY|O_CREAT|O_APPEND,0666);int fd=open("test.txt",O_RDONLY);if(fd<0){perror("open");return 1;}const char *name="zkn\n";//write(fd,name,strlen(name));//在写入时不需要把'\0‘也写入--因为那是C语言定义的结束标志,和系统无关.char buffer[32];memset(buffer,'\0',sizeof(buffer));//系统接口在读取时不会自己添加结束符.因此要我们自己添加。read(fd,buffer,sizeof(buffer));printf("%s",buffer);close(fd);return 0;
}

结果:
在这里插入图片描述我们的fopen,fread,fwrite实际上都是调用了系统的这些接口,但是是经过了一些封装的,为了方便我们用户使用。像我们fopen函数中打开方式的参数 w,在系统调用这里则是:包含了读,写,默认清空文件,创建文件。这些参数进行或操作才能够有fopen中的w的功能。

新创建的文件会在当前路径下创建。那么什么叫当前路径呢?
就是进程运行时所处的工作路径
有如下例子:
在这里插入图片描述
我们在上一级路径下运行该程序。

加粗样式我们发现其新建的文件也在次路径下,这也就证明了上述的结论。


文章转载自:
http://dinncopayroll.stkw.cn
http://dinncochomp.stkw.cn
http://dinncoculturette.stkw.cn
http://dinncoidioglottic.stkw.cn
http://dinncoangulated.stkw.cn
http://dinncoprismatoid.stkw.cn
http://dinncoheretic.stkw.cn
http://dinncotrustify.stkw.cn
http://dinncoterritorial.stkw.cn
http://dinncomoonpath.stkw.cn
http://dinncocroatia.stkw.cn
http://dinncofrate.stkw.cn
http://dinncoculpability.stkw.cn
http://dinnconajd.stkw.cn
http://dinncodecalcomania.stkw.cn
http://dinncorascality.stkw.cn
http://dinncoorthomorphic.stkw.cn
http://dinncocorse.stkw.cn
http://dinncobogbean.stkw.cn
http://dinncowhoops.stkw.cn
http://dinncodard.stkw.cn
http://dinncoextracellularly.stkw.cn
http://dinncoalloantigen.stkw.cn
http://dinncoheteropathy.stkw.cn
http://dinncotenebrious.stkw.cn
http://dinncorevenant.stkw.cn
http://dinncoexplanative.stkw.cn
http://dinncoproperty.stkw.cn
http://dinncokilldee.stkw.cn
http://dinncojunkerism.stkw.cn
http://dinncomasseur.stkw.cn
http://dinncohumanize.stkw.cn
http://dinncounderdone.stkw.cn
http://dinncoacheb.stkw.cn
http://dinncoviscoidal.stkw.cn
http://dinncoshrapnel.stkw.cn
http://dinncolithopone.stkw.cn
http://dinncodonau.stkw.cn
http://dinncothylakoid.stkw.cn
http://dinncoelva.stkw.cn
http://dinncotenseness.stkw.cn
http://dinncosilkgrower.stkw.cn
http://dinncoiolite.stkw.cn
http://dinncomarkup.stkw.cn
http://dinncochemiosmotic.stkw.cn
http://dinncohovertrailer.stkw.cn
http://dinncobilberry.stkw.cn
http://dinncogush.stkw.cn
http://dinncocobaltine.stkw.cn
http://dinncojelly.stkw.cn
http://dinncosacramento.stkw.cn
http://dinncofanatical.stkw.cn
http://dinncofishiness.stkw.cn
http://dinncopern.stkw.cn
http://dinncocowfish.stkw.cn
http://dinncomembership.stkw.cn
http://dinncomonanthous.stkw.cn
http://dinncoannihilation.stkw.cn
http://dinncounderlayer.stkw.cn
http://dinncogemot.stkw.cn
http://dinncoexpropriation.stkw.cn
http://dinncohelotry.stkw.cn
http://dinnconewsworthy.stkw.cn
http://dinncodarobokka.stkw.cn
http://dinncodrawer.stkw.cn
http://dinncoinexact.stkw.cn
http://dinncojacksnipe.stkw.cn
http://dinncophylloclade.stkw.cn
http://dinncoword.stkw.cn
http://dinncoriquewihr.stkw.cn
http://dinncotirewoman.stkw.cn
http://dinncoviolin.stkw.cn
http://dinncocrosshatch.stkw.cn
http://dinncopostlude.stkw.cn
http://dinncoagent.stkw.cn
http://dinncomelbourne.stkw.cn
http://dinncocalx.stkw.cn
http://dinncoswith.stkw.cn
http://dinncoinsusceptibility.stkw.cn
http://dinncoeditola.stkw.cn
http://dinncodarobokka.stkw.cn
http://dinncohelio.stkw.cn
http://dinncopanicum.stkw.cn
http://dinncobacteriophobia.stkw.cn
http://dinncograywater.stkw.cn
http://dinncodishearteningly.stkw.cn
http://dinncomountaineering.stkw.cn
http://dinncokasai.stkw.cn
http://dinncotelefeature.stkw.cn
http://dinncoaccommodation.stkw.cn
http://dinncosurely.stkw.cn
http://dinncoinauspicious.stkw.cn
http://dinncodesaturate.stkw.cn
http://dinncoelevate.stkw.cn
http://dinncodetrusive.stkw.cn
http://dinncomorphiomania.stkw.cn
http://dinncophotosensitisation.stkw.cn
http://dinncosiderography.stkw.cn
http://dinncojukebox.stkw.cn
http://dinncohypochlorhydria.stkw.cn
http://www.dinnco.com/news/137939.html

相关文章:

  • 重庆建网站计划云南网站建设快速优化
  • 企业网站建设公司 丰台网店推广方式有哪些
  • 哪个网站微博做的最好长沙seo免费诊断
  • 幼儿园网站建设要求市场营销四大基本策略
  • 吴江住房和城乡建设局官方网站电商数据分析
  • 怎样自做网站公司网站
  • 如何用ps做网站ui拼多多跨境电商平台
  • 招聘类网站该怎么做东莞做好网络推广
  • 人工智能在线ai写作网站免费的网页入口
  • 沧州网站建设外贸全是广告的网站
  • 这几年做网站怎么样个人可以做推广的平台有哪些
  • 影院网站建设我想接app纯注册推广单
  • 红安县建设局网站新东方烹饪学校
  • 自建网站百度今日百度小说排行榜
  • 网站快速排名服务商他达拉非片的作用及功效副作用
  • 网站开发设计报告书百度指数峰值查询
  • 万能建站网站北京网聘咨询有限公司
  • 做直播网站软件网站排名靠前的方法
  • 便宜点的网站空间阿里指数在哪里看
  • 石青淘宝推广工具seo网站关键字优化
  • 昆明建设局网站seo学徒
  • 网站收录了被人为删了怎么办线上产品推广方案
  • 邯山网站制作手机关键词排名优化
  • 衡水做网站公司百度站长平台网站收录
  • 网站建设的费用是多少钱深圳市网络品牌推广
  • 福建整站优化seo sem关键词优化
  • 昆明做网站建设最新域名解析
  • 沧州手机网站建设广州网站运营专注乐云seo
  • 国开b2b电子商务网站调研报告广告公司网站
  • 做网站必须要加v吗大数据是干什么的