Returns true if the rendered file is up to date against the source.

@param string      $renderFile
@param string      $filename
@param PugJsEngine $pug

@return bool
547952
public static function pugJsCacheCheck($renderFile, $filename, self $pug)
    {
        return file_exists($renderFile) && (
            filemtime($renderFile) >= filemtime($filename) ||
            !$pug->getDefaultOption('upToDateCheck')
        );
    }
135749
public function isSaved(PluginBundleInterface $plugin)
    {
        if (null !== $this->pluginRepository->findOneByBundleFQCN(get_class($plugin))) {
            return true;
        }

        return false;
    }
344547
def __is_current(filepath):
    ''''''
    if not __DOWNLOAD_PARAMS['auto_update']:
        return True

    if not os.path.isfile(filepath):
        return False

    return datetime.datetime.utcfromtimestamp(os.path.getmtime(filepath)) \
        > __get_last_update_time()
263314
public function isStaticFile($sitePath, $siteName, $uri)
    {
        if (strpos($uri, '/site') === 0 && strpos($uri, '/site/themes') !== 0) {
            return false;
        } elseif (strpos($uri, '/local') === 0 || strpos($uri, '/statamic') === 0) {
            return false;
        } elseif ($this->isActualFile($staticFilePath = $sitePath.$uri)) {
            return $staticFilePath;
        } elseif ($this->isActualFile($staticFilePath = $sitePath.'/public'.$uri)) {
            return $staticFilePath;
        }

        return false;
    }
1263632
protected function checkURI($jsonFile)
    {
        //If file doesn't exist, check the directory.
        if (!file_exists($jsonFile)) {
            $jsonFile = dirname($jsonFile);
        }

        if (!is_writable($jsonFile)) {
            throw new Klarna_FileNotWritableException($jsonFile);
        }

        if (!is_readable($jsonFile)) {
            throw new Klarna_FileNotReadableException($jsonFile);
        }
    }
492029
public boolean exists(String filename)
        throws IOException, ServerException {
        if (filename == null) {
            throw new IllegalArgumentException("Required argument missing");
        }
        try {
            Reply reply =
                controlChannel.exchange(new Command("RNFR", filename));
            if (Reply.isPositiveIntermediate(reply)) {
                controlChannel.execute(new Command("ABOR"));
                return true;
            } else {
                return false;
            }
        } catch (FTPReplyParseException rpe) {
            throw ServerException.embedFTPReplyParseException(rpe);
        } catch (UnexpectedReplyCodeException urce) {
            throw ServerException.embedUnexpectedReplyCodeException(
                                urce,
                                "Abort failed");
        }
    }
635490
public function validateUploadedFile($sName, array $aUploadedFile)
    {
        $this->sErrorMessage = '';
        // Verify the file extension
        $xDefault = $this->xConfig->getOption('upload.default.types');
        $aAllowed = $this->xConfig->getOption('upload.files.' . $sName . '.types', $xDefault);
        if(is_array($aAllowed) && !in_array($aUploadedFile['type'], $aAllowed))
        {
            $this->sErrorMessage = $this->xTranslator->trans('errors.upload.type', $aUploadedFile);
            return false;
        }
        // Verify the file extension
        $xDefault = $this->xConfig->getOption('upload.default.extensions');
        $aAllowed = $this->xConfig->getOption('upload.files.' . $sName . '.extensions', $xDefault);
        if(is_array($aAllowed) && !in_array($aUploadedFile['extension'], $aAllowed))
        {
            $this->sErrorMessage = $this->xTranslator->trans('errors.upload.extension', $aUploadedFile);
            return false;
        }
        // Verify the max size
        $xDefault = $this->xConfig->getOption('upload.default.max-size', 0);
        $iSize = $this->xConfig->getOption('upload.files.' . $sName . '.max-size', $xDefault);
        if($iSize > 0 && $aUploadedFile['size'] > $iSize)
        {
            $this->sErrorMessage = $this->xTranslator->trans('errors.upload.max-size', $aUploadedFile);
            return false;
        }
        // Verify the min size
        $xDefault = $this->xConfig->getOption('upload.default.min-size', 0);
        $iSize = $this->xConfig->getOption('upload.files.' . $sName . '.min-size', $xDefault);
        if($iSize > 0 && $aUploadedFile['size'] < $iSize)
        {
            $this->sErrorMessage = $this->xTranslator->trans('errors.upload.min-size', $aUploadedFile);
            return false;
        }
        return true;
    }
202769
async function fileExists(f) {
  debug(`fileExists called with: ${JSON.stringify(arguments)}`);
  try {
    await fs.statAsync(f);
    return f;
  } catch (e) {
    throw e;
  }
}
257668
function isFile(p) {
    if (!fs.existsSync(p)) {
        return false;
    }
    try {
        let stats = fs.statSync(p);
        return stats.isFile();
    } catch (e) {
        return false;
    }
}
103919
public function file_exists($contextid, $component, $filearea, $itemid, $filepath, $filename) {
        $filepath = clean_param($filepath, PARAM_PATH);
        $filename = clean_param($filename, PARAM_FILE);

        if ($filename === '') {
            $filename = '.';
        }

        $pathnamehash = $this->get_pathname_hash($contextid, $component, $filearea, $itemid, $filepath, $filename);
        return $this->file_exists_by_hash($pathnamehash);
    }
1242898
public function isSelected(PhingFile $basedir, $filename, PhingFile $file)
    {
        return $file !== null && $file->canRead();
    }
586844
public function equals($obj)
    {
        if ($obj instanceof QtiFile) {
            if ($this->getFilename() !== $obj->getFilename()) {
                return false;
            } elseif ($this->getMimeType() !== $obj->getMimeType()) {
                return false;
            } else {
                // We have to check the content of the file.
                $myStream = $this->getStream();
                $objStream = $obj->getStream();

                while (feof($myStream) === false && feof($objStream) === false) {
                    $myChunk = fread($myStream, self::CHUNK_SIZE);
                    $objChjunk = fread($objStream, self::CHUNK_SIZE);

                    if ($myChunk !== $objChjunk) {
                        @fclose($myStream);
                        @fclose($objStream);

                        return false;
                    }
                }

                @fclose($myStream);
                @fclose($objStream);

                return true;
            }
        }

        return false;
    }
136101
function checkFileExistsSync(filepath){
  var flag = true;

  try {
    fs.accessSync(filepath, fs.F_OK);
  } catch(e){
    flag = false;
  }

  return flag;
}
765880
function isFile(filePath) {
  if (!isExist(filePath)) return false;
  try {
    const stat = fs.statSync(filePath);
    return stat.isFile();
  } catch (e) {
    return false;
  }
}
1011914
public function isConverterUpdated()
        {
                if ($this->getCurrentFileHash(self::FILENAME_CONVERTER) ==
                        $this->getLocalFileHash(self::FILENAME_CONVERTER)) {
                        return true;
                } else {
                        return false;
                }
        }
862503
private static boolean existsBetterParityFile(
      Codec codec, FileStatus srcStat, Configuration conf) throws IOException {
    for (Codec c : Codec.getCodecs()) {
      if (c.priority > codec.priority) {
        ParityFilePair ppair = ParityFilePair.getParityFile(
            c, srcStat, conf);
        if (ppair != null) {
          return true;
        }
      }
    }
    return false;
  }
1126029
public static function isGdFile($filename)
    {
        if (!is_file($filename) || !is_readable($filename)) {
            throw new \InvalidArgumentException(sprintf(
                    '"%s" Is Not A Readable File', $filename
            ));
        }
        $result = false;
        $f = null;
        if (($f = @fopen($filename, 'r'))) {
            if (($id = @fread($f, 3))) {
                $result = ('gd2' === strtolower($id)) ? true : false;
            }
        }
        @fclose($f);

        return $result;
    }