SplFileInfo::setFileClass

(PHP 5 >= 5.1.2, PHP 7) Sets the class used with SplFileInfo::openFile() public void SplFileInfo::setFileClass ([ string $class_name = "SplFileObject" ] ) Use this method to set a custom class which will be used when SplFileInfo::openFile() is called. The class name passed to this method must be SplFileObject or a class derived from SplFileObject. Parameters: class_name

SplFileInfo::getSize

(PHP 5 >= 5.1.2, PHP 7) Gets file size public int SplFileInfo::getSize ( void ) Returns the filesize in bytes for the file referenced. Returns: The filesize in bytes. Exception: A RuntimeException will be thrown if the file does not exist or an error occurs. See also: filesize() -

SplFileInfo::isDir

(PHP 5 >= 5.1.2, PHP 7) Tells if the file is a directory public bool SplFileInfo::isDir ( void ) This method can be used to determine if the file is a directory. Returns: Returns TRUE if a directory, FALSE otherwise. Examples: SplFileInfo::isDir() example <?php $d = new SplFileInfo(dirname(__FILE__)); var_dump($d-&g

SplFileInfo::isExecutable

(PHP 5 >= 5.1.2, PHP 7) Tells if the file is executable public bool SplFileInfo::isExecutable ( void ) Checks if the file is executable. Returns: Returns TRUE if executable, FALSE otherwise. Examples: SplFileInfo::isExecutable() example <?php $info = new SplFileInfo('/usr/bin/php'); var_dump($info->isExecutable()

SplFileInfo::isFile

(PHP 5 >= 5.1.2, PHP 7) Tells if the object references a regular file public bool SplFileInfo::isFile ( void ) Checks if the file referenced by this SplFileInfo object exists and is a regular file. Returns: Returns TRUE if the file exists and is a regular file (not a link), FALSE otherwise. Examples: SplFileInfo::isFile() example

SplFileInfo::getType

(PHP 5 >= 5.1.2, PHP 7) Gets file type public string SplFileInfo::getType ( void ) Returns the type of the file referenced. Returns: A string representing the type of the entry. May be one of file, link, or dir Exception: Throws a RuntimeException on error. Examples: SplFileInfo::getType() example <

SplFileInfo::getRealPath

(PHP 5 >= 5.2.2, PHP 7) Gets absolute path to file public string SplFileInfo::getRealPath ( void ) This method expands all symbolic links, resolves relative references and returns the real path to the file. Returns: Returns the path to the file, or FALSE if the file does not exist. Examples: SplFileInfo::getRealPath() example

SplFileInfo::getPathInfo

(PHP 5 >= 5.1.2, PHP 7) Gets an SplFileInfo object for the path public SplFileInfo SplFileInfo::getPathInfo ([ string $class_name ] ) Gets an SplFileInfo object for the parent of the current file. Parameters: class_name Name of an SplFileInfo derived class to use. Returns: Returns an SplFileInfo object for the parent path of the file.

SplFileInfo::getPathname

(PHP 5 >= 5.1.2, PHP 7) Gets the path to the file public string SplFileInfo::getPathname ( void ) Returns the path to the file. Returns: The path to the file. Examples: SplFileInfo::getPathname() example <?php $info = new SplFileInfo('/usr/bin/php'); var_dump($info->getPathname()); ?> The above example will

SplFileInfo::getPerms

(PHP 5 >= 5.1.2, PHP 7) Gets file permissions public int SplFileInfo::getPerms ( void ) Gets the file permissions for the file. Returns: Returns the file permissions. Examples: SplFileInfo::getPerms() example <?php $info = new SplFileInfo('/tmp'); echo substr(sprintf('%o', $info->getPerms()), -4); $info = new Sp