linux系统中的头文件#include &ls;sys⁄stat.h>?

linux系统中的头文件#include &ls;sys⁄stat.h>?,第1张

调用 stat(),fstat(), lstat(), 等函数时,需要包含 #include <sys/stat.h>头文件,它包含了要用到一些数据类型,结构类型。例如:

dev_t st_dev ID of device containing file

ino_t st_ino file serial number

mode_tst_modemode of file (see below)

nlink_t st_nlink number of links to the file

uid_t st_uid user ID of file

gid_t st_gid group ID of file

dev_t st_rdevdevice ID (if file is character or block special)

off_t st_sizefile size in bytes (if file is a regular file)

time_tst_atime time of last access

time_tst_mtime time of last data modification

time_tst_ctime time of last status change

用法:包含头文件:

#include <sys/types.h>

#include <sys/stat.h>

程序里,需要时可调用下列函数,下面是函数原型

intchmod(const char *, mode_t)

intfchmod(int, mode_t)

intfstat(int, struct stat *)

intlstat(const char *, struct stat *)

intmkdir(const char *, mode_t)

intmkfifo(const char *, mode_t)

intmknod(const char *, mode_t, dev_t)

intstat(const char *, struct stat *)

int main(){

具体的调用语句和程序可写在这里

}

你怎么编译的, cocos2dx的android.mk不能直接编译, 要编译主工程时包含编译. 可以参考tests\proj.android\build_native.sh文件, 把里面的几个环境变量还成你自己的路径再运行即可. 你的主工程的jni目录下的android.mk和application.mk也要参考tests\proj.android\jni里面的对应文件, 主要就是加入cocos2d-x几个工程的依赖.


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11893015.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存