access函数的使用

    转自:http://c.chinaitlab.com/ccjq/752270.html

    int access (const char *pathname, int mode)

    mode      说明

    R_OK      测试读许可权

    W_OK     测试写许可权

    X_OK      测试执行许可权

    F_OK       测试文件是否存在

 

  if (access(pathname, F_OK) == -1)   //测试文件权限,测试文件是否存在
  {
            return false;
 }

posted @ 2012-08-08 16:36  java简单例子  阅读(400)  评论(0编辑  收藏  举报