Difference between revisions of "PHP/file/meta"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< PHP‎ | file
Jump to navigation Jump to search
(Created page with "{{fmt/title|PHP file metadata access}} {{:PHP/file/NAV}} ==Functions== ===Read Meta=== * [https://www.php.net/manual/en/function.file-exists <code>file_exists()</code>] &ndash...")
 
 
Line 2: Line 2:
 
{{:PHP/file/NAV}}
 
{{:PHP/file/NAV}}
 
==Functions==
 
==Functions==
===Read Meta===
+
{| class="wikitable sortable"
* [https://www.php.net/manual/en/function.file-exists <code>file_exists()</code>] &ndash; returns bool indicating whether a file or dir exists
+
! function name || R/W + type || description
* [https://www.php.net/manual/en/function.fileatime.php <code>fileatime()</code>] &ndash; Gets last access time of file
+
|-
* [https://www.php.net/manual/en/function.filectime.php <code>filectime()</code>] &ndash; Gets [[inode]] change time of file
+
| [https://www.php.net/manual/en/function.file-exists <code>file_exists()</code>] || read bool || returns bool indicating whether a file or dir exists
* [https://www.php.net/manual/en/function.filegroup.php <code>filegroup()</code>] &ndash; Gets file group
+
|-
* [https://www.php.net/manual/en/function.fileinode.php <code>fileinode()</code>] &ndash; Gets file [[inode]]
+
| [https://www.php.net/manual/en/function.fileatime.php <code>fileatime()</code>] || read time || Gets last access time of file
* [https://www.php.net/manual/en/function.filemtime.php <code>filemtime()</code>] &ndash; Gets file modification time
+
|-
* [https://www.php.net/manual/en/function.fileowner.php <code>fileowner()</code>] &ndash; Gets file owner
+
| [https://www.php.net/manual/en/function.filectime.php <code>filectime()</code>] || read time || Gets [[inode]] change time of file
* [https://www.php.net/manual/en/function.fileperms.php <code>fileperms()</code>] &ndash; Gets file permissions
+
|-
* [https://www.php.net/manual/en/function.filesize.php <code>filesize()</code>] &ndash; Gets file size
+
| [https://www.php.net/manual/en/function.filegroup.php <code>filegroup()</code>] || read perm || Gets file group
* [https://www.php.net/manual/en/function.filetype.php <code>filetype()</code>] &ndash; Gets file type
+
|-
* [https://www.php.net/manual/en/function.fstat.php <code>fstat()</code>] &ndash; Gets information about a file using an open file pointer
+
| [https://www.php.net/manual/en/function.fileinode.php <code>fileinode()</code>] || read sys || Gets file [[inode]]
* [https://www.php.net/manual/en/function.linkinfo.php <code>linkinfo()</code>] &ndash; Gets information about a link
+
|-
* [https://www.php.net/manual/en/function.lstat.php <code>lstat()</code>] &ndash; Gives information about a file or symbolic link
+
| [https://www.php.net/manual/en/function.filemtime.php <code>filemtime()</code>] || read time || Gets file modification time
* [https://www.php.net/manual/en/function.readlink.php <code>readlink()</code>] &ndash; Returns the target of a symbolic link
+
|-
* [https://www.php.net/manual/en/function.stat.php <code>stat()</code>] &ndash; Gives information about a file
+
| [https://www.php.net/manual/en/function.fileowner.php <code>fileowner()</code>] || read perm || Gets file owner
====bool condition-checks====
+
|-
* is_dir() Tells whether the filename is a directory
+
| [https://www.php.net/manual/en/function.fileperms.php <code>fileperms()</code>] || read perm || Gets file permissions
* is_executable() Tells whether the filename is executable
+
|-
* is_file() Tells whether the filename is a regular file
+
| [https://www.php.net/manual/en/function.filesize.php <code>filesize()</code>] || read int || Gets file size
* is_link() Tells whether the filename is a symbolic link
+
|-
* is_readable() Tells whether a file exists and is readable
+
| [https://www.php.net/manual/en/function.filetype.php <code>filetype()</code>] || read || Gets file type
* is_uploaded_file() Tells whether the file was uploaded via HTTP POST
+
|-
* is_writable() Tells whether the filename is writable
+
| [https://www.php.net/manual/en/function.fstat.php <code>fstat()</code>] || read || Gets information about a file using an open file pointer
* is_writeable() Alias of is_writable
+
|-
===Write Meta===
+
| [https://www.php.net/manual/en/function.linkinfo.php <code>linkinfo()</code>] || read || Gets information about a link
* chgrp() Changes file group
+
|-
* chmod() Changes file mode
+
| [https://www.php.net/manual/en/function.lstat.php <code>lstat()</code>] || read || Gives information about a file or symbolic link
* chown() Changes file owner
+
|-
* clearstatcache() Clears file status cache
+
| [https://www.php.net/manual/en/function.readlink.php <code>readlink()</code>] || read || Returns the target of a symbolic link
* disk_free_space() Returns available space on filesystem or disk partition
+
|-
* disk_total_space() Returns the total size of a filesystem or disk partition
+
| [https://www.php.net/manual/en/function.stat.php <code>stat()</code>] || read || Gives information about a file
* lchgrp() Changes group ownership of symlink
+
|-
* lchown() Changes user ownership of symlink
+
| <code>is_dir()</code> || read is_? || Tells whether the filename is a directory
 +
|-
 +
| <code>is_executable()</code> || read is_? || Tells whether the filename is executable
 +
|-
 +
| <code>is_file()</code> || read is_? || Tells whether the filename is a regular file
 +
|-
 +
| <code>is_link()</code> || read is_? || Tells whether the filename is a symbolic link
 +
|-
 +
| <code>is_readable()</code> || read is_? || Tells whether a file exists and is readable
 +
|-
 +
| <code>is_uploaded_file()</code> || read is_? || Tells whether the file was uploaded via HTTP POST
 +
|-
 +
| <code>is_writable()</code> || read is_? || Tells whether the filename is writable
 +
|-
 +
| <code>is_writeable()</code> || read is_? || Alias of is_writable
 +
|-
 +
| <code>chgrp()</code> || write || Changes file group
 +
|-
 +
| <code>chmod()</code> || write || Changes file mode
 +
|-
 +
| <code>chown()</code> || write || Changes file owner
 +
|-
 +
| <code>clearstatcache()</code> || write || Clears file status cache
 +
|-
 +
| <code>disk_free_space()</code> || write || Returns available space on filesystem or disk partition
 +
|-
 +
| <code>disk_total_space()</code> || write || Returns the total size of a filesystem or disk partition
 +
|-
 +
| <code>lchgrp()</code> || write || Changes group ownership of symlink
 +
|-
 +
| <code>lchown()</code> || write || Changes user ownership of symlink
 +
|-
 +
| [https://www.php.net/manual/en/function.rmdir.php <code>rmdir()</code>] || write: delete || delete a folder
 +
|-
 +
| [https://www.php.net/manual/en/function.unlink.php <code>unlink()</code>] || write: delete || delete a file
 +
|}

Latest revision as of 15:04, 8 May 2025

PHP file metadata access

PHP File fx()

Functions

function name R/W + type description
file_exists() read bool returns bool indicating whether a file or dir exists
fileatime() read time Gets last access time of file
filectime() read time Gets inode change time of file
filegroup() read perm Gets file group
fileinode() read sys Gets file inode
filemtime() read time Gets file modification time
fileowner() read perm Gets file owner
fileperms() read perm Gets file permissions
filesize() read int Gets file size
filetype() read Gets file type
fstat() read Gets information about a file using an open file pointer
linkinfo() read Gets information about a link
lstat() read Gives information about a file or symbolic link
readlink() read Returns the target of a symbolic link
stat() read Gives information about a file
is_dir() read is_? Tells whether the filename is a directory
is_executable() read is_? Tells whether the filename is executable
is_file() read is_? Tells whether the filename is a regular file
is_link() read is_? Tells whether the filename is a symbolic link
is_readable() read is_? Tells whether a file exists and is readable
is_uploaded_file() read is_? Tells whether the file was uploaded via HTTP POST
is_writable() read is_? Tells whether the filename is writable
is_writeable() read is_? Alias of is_writable
chgrp() write Changes file group
chmod() write Changes file mode
chown() write Changes file owner
clearstatcache() write Clears file status cache
disk_free_space() write Returns available space on filesystem or disk partition
disk_total_space() write Returns the total size of a filesystem or disk partition
lchgrp() write Changes group ownership of symlink
lchown() write Changes user ownership of symlink
rmdir() write: delete delete a folder
unlink() write: delete delete a file