Checks whether {@code path} can be opened read-only. Similar to File.exists, but doesn't
require read permission on the parent, so it'll work in more cases, and allow you to
remove read permission from more directories.
189296
public static boolean canOpenReadOnly(String path) {
        try {
            // Use open(2) rather than stat(2) so we require fewer permissions. http://b/6485312.
            FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
            Libcore.os.close(fd);
            return true;
        } catch (ErrnoException errnoException) {
            return false;
        }
    }
1184671
@Override
	public boolean isDirectory(String path) {

		String resourcePath = getResolver().getResourcePath(path);
		return rsBrowser.isDirectory(resourcePath);
	}
981671
def check_path(path, credentials=None):
    
    from thunder.readers import get_file_reader
    reader = get_file_reader(path)(credentials=credentials)
    existing = reader.list(path, directories=True)
    if existing:
        raise ValueError('Path %s appears to already exist. Specify a new directory, '
                         'or call with overwrite=True to overwrite.' % path)
109599
public boolean exists(final Path f) throws IOException {
		try {
			return (getFileStatus(f) != null);
		} catch (FileNotFoundException e) {
			return false;
		}
	}
154921
def is_readable(fpath):
    
    return os.path.isfile(fpath) and os.access(fpath, os.R_OK)
925958
public boolean canRead(String path)
  {
    try {
      ZipEntry entry = getZipEntry(path);

      return entry != null && ! entry.isDirectory();
    } catch (IOException e) {
      log.log(Level.FINE, e.toString(), e);

      return false;
    }
  }
300234
public static File maybeMarkUnreadable(File path)
    {
        File directory = getDirectory(path);
        if (instance.unreadableDirectories.add(directory))
        {
            logger.warn("Blacklisting {} for reads", directory);
            return directory;
        }
        return null;
    }
388930
def check_input_file_or_directory(self, path):
        
        if (not gf.file_can_be_read(path)) and (not os.path.isdir(path)):
            self.print_error(u"Unable to read file or directory '%s'" % (path))
            self.print_error(u"Make sure the path is written/escaped correctly and that you have read permission on it")
            return False
        return True
1268827
@Override
    public Promise<Boolean> exists(String path) {
        return adapter.toPromise(handler -> vertx.fileSystem().exists(path, handler));
    }
950508
def _isFileAccessible(filepath):
    """"""
    directory = os.path.dirname(filepath)
    if not os.access(directory, os.W_OK):
        #Return False if directory does not exist or is not writable
        return False
    if os.path.exists(filepath):
        if not os.access(filepath, os.W_OK):
            #Return False if file is not writable
            return False
        try:
            openfile = os.open(filepath, os.O_WRONLY)
            os.close(openfile)
        except IOError:
            #Return False if file is locked
            return False
    #Return True if file is writtable
    return True
48727
@Override
  protected ListenableFuture<Boolean> nodeExists(String path) {
    final SettableFuture<Boolean> result = SettableFuture.create();

    try {
      LOG.info("Checking existence of path: " + path);
      safeSetFuture(result, client.checkExists().forPath(path) != null);

      // Suppress it since forPath() throws Exception
      // SUPPRESS CHECKSTYLE IllegalCatch
    } catch (Exception e) {
      safeSetException(result, new RuntimeException("Could not check Exist", e));
    }

    return result;
  }
408357
public static boolean isStorageDirAccessible(String path) {
    Path filePath = Paths.get(path);
    return Files.exists(filePath)
        && Files.isReadable(filePath)
        && Files.isWritable(filePath)
        && Files.isExecutable(filePath);
  }
232371
public boolean existFile(String path) {
		FTPFile[] ftpFileArr;
		try {
			ftpFileArr = client.listFiles(path);
		} catch (IOException e) {
			throw new FtpException(e);
		}
		if (ArrayUtil.isNotEmpty(ftpFileArr)) {
			return true;
		}
		return false;
	}
426866
def is_readable(path):
    

    if os.access(path, os.R_OK):
        LOGGER.debug("> '{0}' path is readable.".format(path))
        return True
    else:
        LOGGER.debug("> '{0}' path is not readable.".format(path))
        return False
844576
def read_file(path):
    
    with open(must_exist(path)) as infile:
        r = infile.read()
    return r
769404
function isPathAccessible (filePath) {
  try {
    fs.accessSync(filePath)
    debug(`Utils: isPathAccessible(): ${filePath} exists`)
    return true
  } catch (err) {
    debug(`Utils: isPathAccessible(): ${filePath} does not exist`)
    return false
  }
}
679276
public static boolean isFileExisted(String path)
    {
        File file = new File(path);
        return file.isFile() && file.exists();
    }