Max filemtime at path recursive
@param string $path
@return int
185264
public static function dirMTime($path)
    {
        clearstatcache();
        return max(
            array_map(
                function ($f) {
                    return filemtime($f);
                },
                self::listDirRecursive($path)
            ),
            filemtime($path)
        );
    }
1179553
public function isExpired($path)
    {
        $time = filemtime($this->getCompiledPath($path));

        return $this->twig->isTemplateFresh($path, $time);
    }
412398
public function extfile($path){
        $rtn["fullfilename"] = substr(strrchr($path, "/"), 1);
        $rtn["ext"] = substr(strrchr($path, "."), 1);
        $rtn["filename"] = substr($rtn["fullfilename"], 0, -(strlen($rtn["ext"])+1));
        return $rtn;
     }
699241
public static function rmdir(string $path) {
		ref\file::path($path, true);
		if (! $path || ! @\is_readable($path) || ! @\is_dir($path)) {
			return false;
		}

		// Scan all files in dir.
		if ($handle = @\opendir($path)) {
			while (false !== ($entry = @\readdir($handle))) {
				// Anything but a dot === not empty.
				if (('.' === $entry) || ('..' === $entry)) {
					continue;
				}

				$file = "{$path}{$entry}";

				// Delete files.
				if (@\is_file($file)) {
					@\unlink($file);
				}
				// Recursively delete directories.
				else {
					static::rmdir($file);
				}
			}
			\closedir($handle);
		}

		if (static::empty_dir($path)) {
			@\rmdir($path);
		}

		return ! @\file_exists($path);
	}
308779
protected function getFileMTime($path) {
		$mtime = filemtime($path);
			
		if ($mtime === false) {
			throw new OperationError('Unable to determine modification time of the file: "' . $path . '"');
		}
		
		return $mtime;
	}
317963
public static function getFolder(string $path)
    {
        $arrFolders = explode(DIRECTORY_SEPARATOR, $path);
        $fullPath = "";
        if ($arrFolders[0] !== "") {
            $fullPath = $arrFolders[0];
        }
        unset($arrFolders[0]);
        foreach ($arrFolders as $folder) {
            $fullPath .= DIRECTORY_SEPARATOR . $folder;
            if (file_exists($fullPath) && is_dir($fullPath)) {
                continue;
            }
            mkdir($fullPath, 0775);
        }
        return $path;
    }
470455
private function filemtime($path)
	{
		if($this->embedExpiry)
			return (int)@file_get_contents($path,false,null,0,10);
		else
			return @filemtime($path);
	}
713751
public static function recursive($path)
    {
        if (is_dir($path)) {
            $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST);
            foreach ($iterator as $file) {
                self::_deleteFile($file);
            }
            rmdir($path);
        }
    }
493295
public static function recursiveDelete($path) {
		if(is_file($path)) {
			@unlink($path);

		} else {
			$it = new RecursiveIteratorIterator(
				new RecursiveDirectoryIterator($path),
				RecursiveIteratorIterator::CHILD_FIRST
			);

			foreach ($it as $file) {
				if (in_array($file->getBasename(), array('.', '..'))) {
					continue;
				}elseif ($file->isDir()) {
					rmdir($file->getPathname());
				}elseif ($file->isFile() || $file->isLink()) {
					unlink($file->getPathname());
				}
			}
			rmdir($path);
		}

		return false;
	}
1014360
public function getStorageLogs($path)
    {
        if (!file_exists($path)) {
            return;
        }

        //Load the latest lines, guessing about 15x the number of log entries (for stack traces etc)
        $file = implode("", $this->tailFile($path, $this->lines));

        foreach ($this->getLogs($file) as $log) {
            $this->addMessage($log['header'] . $log['stack'], $log['level'], false);
        }
    }
491720
protected function findFileAt($path)
    {
        try {
            $files = $this->fromDirectory('')
                ->withPrefix($path)
                ->withDelimiter('')
                ->limit(1)
                ->get();
        } catch (ApiRequestFailedException $e) {
            return;
        }

        return $files->get(0);
    }
243609
public function isLast($path)
    {
        return $this->items && $path === array_keys($this->items)[\count($this->items) - 1];
    }
14858
private function needsInitialNewline($path)
    {
        $result = false;
        if (! file_exists($path)) {
            return $result;
        }
        $fh = fopen($path, 'r');
        if ($fh === false) {
            return $result;
        }
        if (fseek($fh, -1, SEEK_END) === 0) {
            $lastChar = fgetc($fh);
            if ($lastChar !== "\n" && $lastChar !== "\r") {
                $result = true;
            }
        }
        fclose($fh);
        return $result;
    }
790332
public static function fromFile($path)
    {
        return new self($path, filesize($path), \DateTime::createFromFormat('U', filemtime($path)));
    }
172683
public function getLastModified(string $path) : DateTime
    {
        if (!$this->exists($path)) {
            throw new FileSystemException("File at path $path not found");
        }

        $modifiedTimestamp = filemtime($path);

        if ($modifiedTimestamp === false) {
            throw new FileSystemException("Failed to get last modified time of $path");
        }

        $modifiedDateTime = DateTime::createFromFormat('U', $modifiedTimestamp);

        if ($modifiedDateTime === false) {
            throw new FileSystemException('Failed to convert last modified time to DateTime object');
        }

        return $modifiedDateTime;
    }
1184191
protected function getMaxPosition($path)
    {
        $connection = $this->getConnection();
        $positionField = $connection->quoteIdentifier('position');
        $level = count(explode('/', $path));
        $bind = ['c_level' => $level, 'c_path' => $path . '/%'];
        $select = $connection->select()->from(
            $this->getTable('mst_blog_category_entity'),
            'MAX(' . $positionField . ')'
        )->where(
            $connection->quoteIdentifier('path') . ' LIKE :c_path'
        )->where($connection->quoteIdentifier('level') . ' = :c_level');

        $position = $connection->fetchOne($select, $bind);
        if (!$position) {
            $position = 0;
        }
        return $position;
    }
42007
public function time( $path )
	{
		try {
			return $this->fs->lastModified( $path );
		} catch( \Exception $e ) {
			throw new Exception( $e->getMessage(), 0, $e );
		}
	}