PHP/file/meta: Difference between revisions
from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
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..." |
No edit summary |
||
| Line 2: | Line 2: | ||
{{:PHP/file/NAV}} | {{:PHP/file/NAV}} | ||
==Functions== | ==Functions== | ||
= | {| class="wikitable sortable" | ||
! function name || R/W + type || description | |||
|- | |||
| [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.fileatime.php <code>fileatime()</code>] || read time || Gets last access time of file | |||
|- | |||
| [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.filegroup.php <code>filegroup()</code>] || read perm || Gets file group | |||
|- | |||
| [https://www.php.net/manual/en/function.fileinode.php <code>fileinode()</code>] || read sys || Gets file [[inode]] | |||
|- | |||
| [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.fileowner.php <code>fileowner()</code>] || read perm || Gets file owner | |||
|- | |||
| [https://www.php.net/manual/en/function.fileperms.php <code>fileperms()</code>] || read perm || Gets file permissions | |||
|- | |||
| [https://www.php.net/manual/en/function.filesize.php <code>filesize()</code>] || read int || Gets file size | |||
|- | |||
| [https://www.php.net/manual/en/function.filetype.php <code>filetype()</code>] || read || Gets file type | |||
|- | |||
| [https://www.php.net/manual/en/function.fstat.php <code>fstat()</code>] || read || Gets information about a file using an open file pointer | |||
|- | |||
| [https://www.php.net/manual/en/function.linkinfo.php <code>linkinfo()</code>] || read || Gets information about a link | |||
|- | |||
| [https://www.php.net/manual/en/function.lstat.php <code>lstat()</code>] || read || Gives information about a file or symbolic link | |||
|- | |||
| [https://www.php.net/manual/en/function.readlink.php <code>readlink()</code>] || read || Returns the target of a symbolic link | |||
|- | |||
| [https://www.php.net/manual/en/function.stat.php <code>stat()</code>] || read || Gives information about a file | |||
|- | |||
| <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
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 |
