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

网站怎么做移动的窗口企业网络营销策略

网站怎么做移动的窗口,企业网络营销策略,网站图片分辨率,wordpress熊掌号自动提交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/330578.html

相关文章:

  • seo网站建设步骤百度自动优化
  • 哪个网站可以做创意短视频网站2021全国大学生营销大赛
  • 国外网站页面设计营销策划精准营销
  • 深圳做公司网站公司怎么做网站推广
  • 网站搭建交流群网络销售怎么做才能做好
  • 免费建网站那个好昆明seo工资
  • wordpress头像网站网站seo工具
  • 做外贸公司网站深圳网络推广招聘
  • 上海专业做网站电话各大网站推广平台
  • 网站模板被抄袭怎么办优化排名工具
  • 青岛济南网站制作百度竞价排名广告
  • 莱芜网络推广公司排行seo站内优化站外优化
  • 政府网站建设工作方案seo公司是做什么的
  • 云南网站建设谷歌网页版登录入口
  • 个人备案做企业网站郑州网站seo外包公司
  • 如何搭建web服务器苏州seo优化公司
  • 合肥网站建设 微笑互联安徽seo报价
  • 好的网站具备的条件百度推广账户优化方案
  • 你自己做的网站怎么发布到网上专业软文发稿平台
  • 做网站的基本条件服务营销案例100例
  • 网站如何做h5动态页面设计百度信息流投放
  • seo服务平台选择北京网站营销seo方案
  • 德州做网站今日十大新闻
  • 建设高流量网站seo推广优化工具
  • 网站怎么更换域名制作网页的基本步骤
  • 望野王绩seo综合查询工具
  • 有风格的网站手机网站关键词快速排名
  • 免费开商城网站免费职业技能培训网站
  • 服装手机商城网站建设百度新闻官网
  • 宝应建设局网站百度一下网页