Zymba Documentation
IO
object @IO() {
EOL;
append(string $path, string $string): int {}
appendLine(string $path, string $string): int {}
canExecute(string $path): bool {}
canRead(string $path): bool {}
canWrite(string $path): bool {}
copy(string $path, string $target) {}
countDirectories(string $path): int {}
countFiles(string $path): int {}
crc32(string $path): int {}
createDirectories(string $path, int $mode) {}
createDirectory(string $path, int $mode) {}
createFile(string $path): bool {}
createHardLink(string $path, string $target) {}
createSymbolicLink(string $path, string $target) {}
createTempFile(string $prefix): string {}
delete(string $path): string {}
deleteIfExists(string $path): bool {}
echo(string $path): int {}
execute(string $command): string {}
executeFlushed(string $command): int {}
exists(string $path): bool {}
getFreeSpace(string $path): float {}
getGroupID(string $path): int {}
getLastAccess(): int {}
getLastModified(): int {}
getPermissions(): int {}
getSize(string $path): int {}
getTotalSpace(string $path): float {}
getUsedSpace(string $path): float {}
getUserID(string $path): int {}
hasExistingTarget(string $path): bool {}
hasSameContent(string $path1, string $path2): bool {}
isDirectory(string $path): bool {}
isFile(string $path): bool {}
isRegularDirectory(string $path): bool {}
isRegularFile(string $path): bool {}
isSameFile(string $path1, string $path2): bool {}
isSymbolicLink(string $path): bool {}
listDirectories(string $path): object {}
listFiles(string $path): object {}
move(string $path, string $target) {}
quoteCommandArgument(string $argument): string {}
read(string $path, ?int $length): string {}
readCSV(string $path, string $delimiter): object {}
readJSON(string $path): mixed {}
readLines(string $path): object {}
readModifyWrite(string $path, function $callback, ?object $bind): string {}
readNonEmptyLines(string $path): object {}
readSymbolicLink(string $path): string {}
selectReadyStreams(?object $read, ?object $write, ?object $exceptional, ?number $timeout): int {}
setGroupByID(string $path, int $id) {}
setGroupByName(string $path, string $name) {}
setLastAccess(string $path, ?int $timestamp) {}
setLastModified(string $path, ?int $timestamp) {}
setPermissions(string $path, int $mode) {}
setUserByID(string $path, int $id) {}
setUserByName(string $path, string $name) {}
truncate(string $path, int $size) {}
write(string $path, string $string, ?int $length): int {}
writeCSV(string $path, object $array, string $delimiter): int {}
writeJSON(string $path, mixed $value): int {}
}
Static IO related constants, prototypes and functions.
Functions
Copies an existing file to a specific target.
@IO.copy(string $path, string $target): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| target | string | "" |
Creates directories recursively.
@IO.createDirectories(string $path, int $mode): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| mode | int | 0o777 |
Creates a directory.
@IO.createDirectory(string $path, int $mode): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| mode | int | 0o777 |
Creates a hard link to a specific target.
@IO.createHardLink(string $path, string $target): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| target | string | "" |
Creates a symbolic link to a specific target.
@IO.createSymbolicLink(string $path, string $target): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| target | string | "" |
Gets the timestamp for the last access date and time of an existing file.
@IO.getLastAccess(): int
Returns
| Type | Value |
|---|---|
int |
Gets the timestamp for the last modification date and time of an existing file.
@IO.getLastModified(): int
Returns
| Type | Value |
|---|---|
int |
Gets the permissions of an existing file as the numeric mode.
@IO.getPermissions(): int
Returns
| Type | Value |
|---|---|
int |
Moves an existing file to a specific target.
@IO.move(string $path, string $target): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| target | string | "" |
Sets the group of an exiting file by ID.
@IO.setGroupByID(string $path, int $id): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| id | int | 0 |
Sets the group of an exiting file by name.
@IO.setGroupByName(string $path, string $name): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| name | string | "" |
Sets the last access date and time of an exiting file to a specific timestamp.
@IO.setLastAccess(string $path, ?int $timestamp): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| timestamp | ?int | now |
Sets the last modification date and time of an exiting file to a specific timestamp.
@IO.setLastModified(string $path, ?int $timestamp): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| timestamp | ?int | now |
Sets the permissions of an exiting file to a specific numeric mode.
@IO.setPermissions(string $path, int $mode): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| mode | int | 0o777 |
Sets the user of an exiting file by ID.
@IO.setUserByID(string $path, int $id): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| id | int | 0 |
Sets the user of an exiting file by name.
@IO.setUserByName(string $path, string $name): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| name | string | "" |
Truncates an existing file to a specific size in number of bytes.
@IO.truncate(string $path, int $size): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| size | int | 0 |