SplFileInfo
class SplFileInfo implements Stringable (View source)
The SplFileInfo class offers a high-level object oriented interface to information for an individual file.
Methods
Construct a new SplFileInfo object
Gets the path without filename
Gets the filename
Gets the file extension
Gets the base name of the file
Gets the path to the file
Gets file permissions
Gets the inode for the file
Gets file size
Gets the owner of the file
Gets the file group
Gets last access time of the file
Gets the last modified time
Gets the inode change time
Gets file type
Tells if the entry is writable
Tells if file is readable
Tells if the file is executable
Tells if the object references a regular file
Tells if the file is a directory
Tells if the file is a link
Gets the target of a link
Gets absolute path to file
Gets an SplFileInfo object for the file
Gets an SplFileInfo object for the path
Gets an SplFileObject object for the file
Sets the class name used with SplFileInfo::openFile
Sets the class used with getFileInfo and getPathInfo
Returns the path to the file as a string
No description
No description
No description
Details
__construct(string $filename)
Construct a new SplFileInfo object
string
getPath()
Gets the path without filename
string
getFilename()
Gets the filename
string
getExtension()
Gets the file extension
string
getBasename(string $suffix = '')
Gets the base name of the file
string
getPathname()
Gets the path to the file
int|false
getPerms()
Gets file permissions
int|false
getInode()
Gets the inode for the file
int|false
getSize()
Gets file size
int|false
getOwner()
Gets the owner of the file
int|false
getGroup()
Gets the file group
int|false
getATime()
Gets last access time of the file
int|false
getMTime()
Gets the last modified time
int|false
getCTime()
Gets the inode change time
string|false
getType()
Gets file type
bool
isWritable()
Tells if the entry is writable
bool
isReadable()
Tells if file is readable
bool
isExecutable()
Tells if the file is executable
bool
isFile()
Tells if the object references a regular file
bool
isDir()
Tells if the file is a directory
bool
isLink()
Tells if the file is a link
string|false
getLinkTarget()
Gets the target of a link
string|false
getRealPath()
Gets absolute path to file
SplFileInfo
getFileInfo(T> $class = null)
Gets an SplFileInfo object for the file
SplFileInfo|null
getPathInfo(T> $class = null)
Gets an SplFileInfo object for the path
SplFileObject
openFile(string $mode = 'r', bool $useIncludePath = false, resource $context = null)
Gets an SplFileObject object for the file
void
setFileClass(T> $class = SplFileObject::class)
Sets the class name used with SplFileInfo::openFile
void
setInfoClass(T> $class = SplFileInfo::class)
Sets the class used with getFileInfo and getPathInfo
string
__toString()
Returns the path to the file as a string
final void
_bad_state_ex()
No description
__wakeup()
No description
array
__debugInfo()
No description