Return True if the given base dir is not accessible or writeable
548073
def _no_access(basedir):
    ''' 

    '''
    import os
    return not os.access(basedir, os.W_OK | os.X_OK)
1161963
public static void checkValidDir(final File dir) {
        checkNotNull("dir", dir);
        if (!dir.exists()) {
            throw new IllegalArgumentException("The directory '" + dir + "' does not exist!");
        }
        if (!dir.isDirectory()) {
            throw new IllegalArgumentException("The name '" + dir + "' is not a directory!");
        }
    }
1161945
private boolean canWriteErrorDir(File errorPath) {
        String[] files = errorPath.list();
        if (files != null && files.length > FILE_CONTENT_LOG_MAX_FILE_NUM) {
            long now = System.currentTimeMillis();
            int delNum = 0;
            for (String filename : files) {
                File errImg = new File(errorPath, filename);
                if (now - errImg.lastModified() > EXPIRED_PERIOD) {
                    errImg.delete();
                    delNum++;
                }
            }

            if (files.length - delNum <= FILE_CONTENT_LOG_MAX_FILE_NUM) {
                return true;
            }

            return false;
        }

        return true;
    }
1094074
public static boolean isAvailable() {
    try {
      String osName = System.getProperty("os.name");
      if (!osName.startsWith("Linux")) {
        LOG.info("ProcfsBasedProcessTree currently is supported only on "
            + "Linux.");
        return false;
      }
    } catch (SecurityException se) {
      LOG.warn("Failed to get Operating System name. " + se);
      return false;
    }
    return true;
  }
161172
def is_base_dir(d):
    ''''''
    if not dir_param_valid(d): # pragma: no cover
        raise 
    else:
        mfn = os.path.join(d,'s2') #marker name. it must be a directory.
        return os.path.isdir(mfn)
851660
def is_readable(path=None):
    
    if os.path.isfile(path) and os.access(path, os.R_OK):
        return True
    return False
1040318
def _check_directory(directory):
    """"""
    if directory is not None:
        if not exists(directory):
            raise CommandError(
                "Cannot run command - directory {0} does not exist".format(directory)
            )

        if not isdir(directory):
            raise CommandError(
                "Cannot run command - specified directory {0} is not a directory.".format(
                    directory
                )
            )
1052649
public function canWrite()
    {
        $ht = $this->getHTaccessFilename();
        $fs = $this->getFilesystem();

        return (bool) (@$fs->isFile($ht) ? @$fs->isWritable($ht) : @$fs->isWritable(@dirname($ht)));
    }
1219392
static protected function is_log_dir_writable()
  {
    if (!is_writable(self::$log_dir))
      if (self::$to_stderr)
        error_log("Could't open " . self::$log_dir . " for writing. Does " . self::$log_dir . " exist? Permissions?");
  }
390367
def check_shm():
        
        import stat
        shm_path = '/dev/shm'
        if os.name == 'posix' and os.path.exists(shm_path):
            # We get the access rights, and we check them
            mode = stat.S_IMODE(os.lstat(shm_path)[stat.ST_MODE])
            if not mode & stat.S_IWUSR or not mode & stat.S_IRUSR:
                logger.critical("The directory %s is not writable or readable."
                                "Please make it read writable: %s", shm_path, shm_path)
                print("The directory %s is not writable or readable."
                      "Please make it read writable: %s" % (shm_path, shm_path))
                sys.exit(2)
87558
static function isWriteable( $dirname )
    {
        if ( eZSys::osType() != 'win32' )
            return is_writable( $dirname );

        /* PHP function is_writable() doesn't work correctly on Windows NT descendants.
         * So we have to use the following hack on those OSes.
         */
        $tmpfname = $dirname . eZSys::fileSeparator() . "ezsetup_" . md5( microtime() ) . ".tmp";

        // try to create temporary file
        if ( !( $fp = @fopen( $tmpfname, "w" ) ) )
            return FALSE;

        fclose( $fp );
        unlink( $tmpfname );

        return TRUE;
    }
1198235
public static boolean isDirWritable(final File dir) {
    File testFile = null;
    try {
      testFile = new File(dir, "_tmp");
      /*
       * Create and delete a dummy file in order to check file permissions. Maybe
       * there is a safer way for this check.
       */
      testFile.createNewFile();
    } catch (final IOException e) {
      return false;
    } finally {
      if (testFile != null) {
        testFile.delete();
      }
    }
    return true;
  }
7004
def dir_exists(self):
        

        r = requests.request(self.method if self.method else 'HEAD', self.url, **self.storage_args)
        try: r.raise_for_status()
        except Exception: return False

        return True
836389
public function checkConfigDir()
    {
        if (is_writable(dirname(__FILE__) . '/../../../config'))
            return true;
        
        $this->addError('isConfigDirWritable', Yii::t('Install.main','Configuration directory is not writable. This must be corrected before your settings can be applied.'));
        return false;
    }
1168387
def is_directory(self, path):
        """"""
        return self._getReturnCodeCmd([self._hadoop_cmd, 'fs', '-test', '-d', self._full_hdfs_path(path)]) == 0
14102
function isWriteable(file) {
  let writePermission = true;
  try {
    const __fd = fs.openSync(file, 'a');
    fs.closeSync(__fd);
  } catch (e) {
    /* istanbul ignore next */
    writePermission = false;
  }

  return writePermission;
}
401948
private function isPathWritable(): bool
    {
        if (! file_exists($this->path)) {
            return is_writable(dirname($this->path));
        }

        return is_writable($this->path);
    }