posix_eaccess
  
   ファイルがアクセスできるかを調べる
  
  
 
  説明
  
   bool posix_eaccess(string $filename, int $flags = 0)
  
  
 
  パラメータ
  
   
    
     - 
filename 
     - 
      
       調べるファイル名
      
      
    
    
     - 
flags 
     - 
      
        POSIX_F_OK,
        POSIX_R_OK, POSIX_W_OK,
        POSIX_X_OK のうち、ひとつ以上のビットマスクの組み合わせです。
       
       
        POSIX_R_OK, POSIX_W_OK,
        POSIX_X_OK についてはそれぞれ、
        ファイルが存在し読み取り可能、ファイルが存在し書き込み可能、
        ファイルが存在し実行可能という意味になります。
        POSIX_F_OK は、
        ファイルが存在するかどうかだけを調べます。
       
      
    
   
  
  
 
  戻り値
  
   成功した場合に true を、失敗した場合に false を返します。
  
  
 
 
  例
   
   
    例1 posix_eaccess の例
    
     このサンプルは、$file が読み取り可能かつ書き込み可能かを調べます。
     そうでない場合、エラーメッセージを出力します。
    
 
    
<?php
$file = 'some_file';
if (posix_eaccess($file, POSIX_R_OK | POSIX_W_OK)) {
    echo 'The file is readable and writable!';
} else {
    $error = posix_get_last_error();
    echo "Error $error: " . posix_strerror($error);
}
?>
 
      
    
  
  
 
  参考
  
   
    - posix_get_last_error
 
    - posix_strerror
 
    - posix_access