File system (create delete files folders) (tag)

copy_dir()

Copies a directory from one location to another via the WordPress Filesystem Abstraction.

get_dirsize()

Gets the size of a directory in bytes. The result is cached to a transient option (or object cache).

list_files()

Get a list of files from the specified directory and from all nested directories (up to 100 levels of nesting).

recurse_dirsize()

Recursively gets the size of a directory in bytes. That is, you can specify the parent folder and get its full size: including nested folders.

unzip_file()

Unzips the specified ZIP archive to a folder on the server using the WordPress filesystem API.

wp_delete_file()

Delete a file. This function is a wrapper for PHP's unlink() function — it uses wp_delete_file filter before deleting a file.

wp_delete_file_from_directory()

Deletes the specified file from the specified folder, only if the file is located in that folder.

WP_Filesystem()

Creates an object for working with files in WordPress. The created object is saved in the variable global $wp_filesystem.

WP_Filesystem_Direct{}

WordPress file system class for direct (non-FTP) file and directory (folder) operations through PHP.

wp_mkdir_p()

Recursively creates a directory (folder) at the specified path. Does nothing if the folder already exists. Grants parent permissions to new folders.

wp_tempnam()

Creates an empty temporary writable file with a unique name in the temporary directory. After use, the file must be deleted using unlink();