Provides object-oriented file and directory operations.
Object member access may follow construction directly, so a temporary variable is not required:
if (new File("media")->is_directory()) $children = new File("media")->list_children() end if
Object functions
- append [1.14.10+]
The `append` operation for the File object.
- construct [1.14.10+]
The `construct` operation for the File object.
- copy [1.14.10+]
The `copy` operation for the File object.
- delete [1.14.10+]
The `delete` operation for the File object.
- exists [1.14.10+]
The `exists` operation for the File object.
- is_directory [1.14.10+]
The `is_directory` operation for the File object.
- is_file [1.14.10+]
The `is_file` operation for the File object.
- list [1.14.11+]
This former method name has been replaced by `list_children`.
- list_children [1.14.11+]
Returns the direct children of this directory as a list of File objects.
- make_directories [1.14.10+]
The `make_directories` operation for the File object.
- move [1.14.10+]
The `move` operation for the File object.
- name [1.14.10+]
The `name` operation for the File object.
- open_reader [1.14.10+]
The `open_reader` operation for the File object.
- parent [1.14.10+]
The `parent` operation for the File object.
- path [1.14.10+]
The `path` operation for the File object.
- read [1.14.10+]
The `read` operation for the File object.
- read_lines [1.14.10+]
The `read_lines` operation for the File object.
- size [1.14.10+]
The `size` operation for the File object.
- touch [1.14.10+]
The `touch` operation for the File object.
- write [1.14.10+]
The `write` operation for the File object.

There are no comments on this page.
Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.
Comments powered by BalfComment