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

合肥商业网站建设费用搜索引擎优化的核心本质

合肥商业网站建设费用,搜索引擎优化的核心本质,手机端设计,做一年的网站维护价格1. Linux文件属性 普通文件(文本文件和二进制文件) -, regular file目录文件 d, directory字符设备文件(对应硬件设备,虚拟文件) c, char块设备文件 b, block管道文件 p, pipe套接字文件 s, socket符号链接文件 l, lin…

1. Linux文件属性

  • 普通文件(文本文件和二进制文件) -, regular file
  • 目录文件 d, directory
  • 字符设备文件(对应硬件设备,虚拟文件) c, char
  • 块设备文件 b, block
  • 管道文件 p, pipe
  • 套接字文件 s, socket
  • 符号链接文件 l, link

2. Linux获取文件属性的API

Linux获取文件属性的API也是调用stat命令实现的。

  • int stat(const char *pathname, struct stat *statbuf);
  • 直接获取文件的属性
  • int fstat(int fd, struct stat *statbuf);
  • 根据fd获取已经打开的文件的属性,所以是读取的动态文件属性。
  • int lstat(const char *pathname, struct stat *statbuf);
  • stat和fstat查看的符号链接文件指向的文件的属性,而lstat查看的是符号链接本身的属性。

结构体:

       struct stat {dev_t     st_dev;         /* ID of device containing file */ino_t     st_ino;         /* Inode number */mode_t    st_mode;        /* File type and mode */nlink_t   st_nlink;       /* Number of hard links */uid_t     st_uid;         /* User ID of owner */gid_t     st_gid;         /* Group ID of owner */dev_t     st_rdev;        /* Device ID (if special file) */off_t     st_size;        /* Total size, in bytes */blksize_t st_blksize;     /* Block size for filesystem I/O */blkcnt_t  st_blocks;      /* Number of 512B blocks allocated *//* Since Linux 2.6, the kernel supports nanosecondprecision for the following timestamp fields.For the details before Linux 2.6, see NOTES. */struct timespec st_atim;  /* Time of last access */struct timespec st_mtim;  /* Time of last modification */struct timespec st_ctim;  /* Time of last status change */#define st_atime st_atim.tv_sec      /* Backward compatibility */#define st_mtime st_mtim.tv_sec#define st_ctime st_ctim.tv_sec};st_mode是一个按位定义的文件类型标志,可以用
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define FILE "a.txt"
int main(void)
{int ret = -1;struct stat buf;memset(buf, 0, sizeof(buf));ret = stat(FILE, &buf);if (ret < 0){perror("stat");exit(-1);}printf("inode = %d. \n",buf.st_ino);int res = S_ISREG(buf.st_mode);return 0;
}
  • int access(const char *pathname, int mode);
  • 测试当前环境下当前用户对此文件是否有权限。
int ret = -1;
ret = access(FILE, F_OK);
if (ret < 0)
{printf("Not exist");
}
else
{printf("Exist");
}
  • DIR *opendir(const char *name);
  • opendir打开一个目录后得到一个DIR类型的指针给readdir使用
  • struct dirent *readdir(DIR *dirp);

readdir函数调用一次就会返回一个struct dirent类型的指针,这个指针指向一个结构体变量,这个结构体变量里面记录了一
个目录项(所谓目录项就是目录中的一个子文件)。

http://www.dtcms.com/wzjs/517392.html

相关文章:

  • 什么操作系统做网站搜索引擎google
  • wordpress admin headseo优化的常用手法
  • 官方网站面膜做微商软文推广案例大全
  • 网站建设教程自学网个人怎么创建网站
  • 3 如何进行网站优化设计汕头seo全网营销
  • 成都在哪建设网站关键词优化的价格查询
  • 扬州公司做网站公司哪家好好项目推荐平台
  • 免费追剧网站百度广告价格
  • 网站代运营公司有哪些网站优化seo
  • 购物app开发多少钱宁波seo推荐优化
  • 网站建设栏目图片优化新十条
  • 免费的ftp网站seo课程多少钱
  • 登录不了建设银行网站seo推广排名软件
  • 建设公司的网站制作seo网站优化外包
  • 济宁做网站的公司百度关键词搜索排名统计
  • 哈尔滨建站系统陕西网站seo
  • 司法局网站建设工作汇报百度seo排名优化公司推荐
  • 专门做讲座的英语网站视频营销
  • 网站正能量晚上在线观看视频上海百度竞价托管
  • 代做备案网站网店推广培训
  • 淄博专业网站建设哪家好app开发者需要更新此app
  • html教程下载seo排名优化是什么
  • 日租酒店公寓网站怎么做搜索引擎竞价广告
  • 做淘宝货源批发的网站微信管理软件哪个最好
  • 凡科网做网站能达到什么效果搜索引擎排名大全
  • 深圳做网站公司排名免费seo在线工具
  • 孔夫子旧书网网站谁做的郑州网站运营实力乐云seo
  • 现在网站后台有哪几种模板形式seo技术是什么意思
  • 在海南注册公司需要什么条件江苏seo平台
  • 加强门户网站建设方案推广互联网推广