vertx / io.vertx.rxjava.core.file / FileSystem

# FileSystem

`open class FileSystem`

Contains a broad set of operations for manipulating files on the file system.

A (potential) blocking and non blocking version of each operation is provided.

The non blocking versions take a handler which is called when the operation completes or an error occurs.

The blocking versions are named `xxxBlocking` and return the results, or throw exceptions directly. In many cases, depending on the operating system and file system some of the potentially blocking operations can return quickly, which is why we provide them, but it's highly recommended that you test how long they take to return in your particular application before using them on an event loop.

Please consult the documentation for more information on file system support.

NOTE: This class has been automatically generated from the io.vertx.core.file.FileSystem non RX-ified interface using Vert.x codegen.

### Constructors

<init> | `FileSystem(delegate: FileSystem)`

### Properties

__TYPE_ARG | `static val __TYPE_ARG: TypeArg<FileSystem>`

### Functions

chmod | `open fun chmod(path: String, perms: String, handler: Handler<AsyncResult<Void>>): FileSystem` Change the permissions on the file represented by `path` to `perms`, asynchronously. The permission String takes the form rwxr-x--- as specified here.
chmodBlocking | `open fun chmodBlocking(path: String, perms: String): FileSystem` Blocking version of io.vertx.rxjava.core.file.FileSystem
chmodRecursive | `open fun chmodRecursive(path: String, perms: String, dirPerms: String, handler: Handler<AsyncResult<Void>>): FileSystem` Change the permissions on the file represented by `path` to `perms`, asynchronously. The permission String takes the form rwxr-x--- as specified in {here}. If the file is directory then all contents will also have their permissions changed recursively. Any directory permissions will be set to `dirPerms`, whilst any normal file permissions will be set to `perms`.
chmodRecursiveBlocking | `open fun chmodRecursiveBlocking(path: String, perms: String, dirPerms: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#chmodRecursive`
chown | `open fun chown(path: String, user: String, group: String, handler: Handler<AsyncResult<Void>>): FileSystem` Change the ownership on the file represented by `path` to `user` and {code group}, asynchronously.
chownBlocking | `open fun chownBlocking(path: String, user: String, group: String): FileSystem` Blocking version of
copy | `open fun copy(from: String, to: String, handler: Handler<AsyncResult<Void>>): FileSystem` Copy a file from the path `from` to path `to`, asynchronously. The copy will fail if the destination already exists. `open fun copy(from: String, to: String, options: CopyOptions, handler: Handler<AsyncResult<Void>>): FileSystem` Copy a file from the path `from` to path `to`, asynchronously.
copyBlocking | `open fun copyBlocking(from: String, to: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#copy`
copyRecursive | `open fun copyRecursive(from: String, to: String, recursive: Boolean, handler: Handler<AsyncResult<Void>>): FileSystem` Copy a file from the path `from` to path `to`, asynchronously. If `recursive` is `true` and `from` represents a directory, then the directory and its contents will be copied recursively to the destination `to`. The copy will fail if the destination if the destination already exists.
copyRecursiveBlocking | `open fun copyRecursiveBlocking(from: String, to: String, recursive: Boolean): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#copyRecursive`
createFile | `open fun createFile(path: String, handler: Handler<AsyncResult<Void>>): FileSystem` Creates an empty file with the specified `path`, asynchronously. `open fun createFile(path: String, perms: String, handler: Handler<AsyncResult<Void>>): FileSystem` Creates an empty file with the specified `path` and permissions `perms`, asynchronously.
createFileBlocking | `open fun createFileBlocking(path: String): FileSystem` `open fun createFileBlocking(path: String, perms: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#createFile`
delete | `open fun delete(path: String, handler: Handler<AsyncResult<Void>>): FileSystem` Deletes the file represented by the specified `path`, asynchronously.
deleteBlocking | `open fun deleteBlocking(path: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#delete`
deleteRecursive | `open fun deleteRecursive(path: String, recursive: Boolean, handler: Handler<AsyncResult<Void>>): FileSystem` Deletes the file represented by the specified `path`, asynchronously. If the path represents a directory and `recursive = true` then the directory and its contents will be deleted recursively.
deleteRecursiveBlocking | `open fun deleteRecursiveBlocking(path: String, recursive: Boolean): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#deleteRecursive`
equals | `open fun equals(other: Any?): Boolean`
exists | `open fun exists(path: String, handler: Handler<AsyncResult<Boolean>>): FileSystem` Determines whether the file as specified by the path `path` exists, asynchronously.
existsBlocking | `open fun existsBlocking(path: String): Boolean` Blocking version of `io.vertx.rxjava.core.file.FileSystem#exists`
fsProps | `open fun fsProps(path: String, handler: Handler<AsyncResult<FileSystemProps>>): FileSystem` Returns properties of the file-system being used by the specified `path`, asynchronously.
fsPropsBlocking | `open fun fsPropsBlocking(path: String): FileSystemProps` Blocking version of `io.vertx.rxjava.core.file.FileSystem#fsProps`
getDelegate | `open fun getDelegate(): FileSystem`
hashCode | `open fun hashCode(): Int`
link | `open fun link(link: String, existing: String, handler: Handler<AsyncResult<Void>>): FileSystem` Create a hard link on the file system from `link` to `existing`, asynchronously.
linkBlocking | `open fun linkBlocking(link: String, existing: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#link`
lprops | `open fun lprops(path: String, handler: Handler<AsyncResult<FileProps>>): FileSystem` Obtain properties for the link represented by `path`, asynchronously. The link will not be followed.
lpropsBlocking | `open fun lpropsBlocking(path: String): FileProps` Blocking version of `io.vertx.rxjava.core.file.FileSystem#lprops`
mkdir | `open fun mkdir(path: String, handler: Handler<AsyncResult<Void>>): FileSystem` Create the directory represented by `path`, asynchronously. The operation will fail if the directory already exists. `open fun mkdir(path: String, perms: String, handler: Handler<AsyncResult<Void>>): FileSystem` Create the directory represented by `path`, asynchronously. The new directory will be created with permissions as specified by `perms`. The permission String takes the form rwxr-x--- as specified in here. The operation will fail if the directory already exists.
mkdirBlocking | `open fun mkdirBlocking(path: String): FileSystem` `open fun mkdirBlocking(path: String, perms: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#mkdir`
mkdirs | `open fun mkdirs(path: String, handler: Handler<AsyncResult<Void>>): FileSystem` Create the directory represented by `path` and any non existent parents, asynchronously. The operation will fail if the directory already exists. `open fun mkdirs(path: String, perms: String, handler: Handler<AsyncResult<Void>>): FileSystem` Create the directory represented by `path` and any non existent parents, asynchronously. The new directory will be created with permissions as specified by `perms`. The permission String takes the form rwxr-x--- as specified in here. The operation will fail if the directory already exists.
mkdirsBlocking | `open fun mkdirsBlocking(path: String): FileSystem` `open fun mkdirsBlocking(path: String, perms: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#mkdirs`
move | `open fun move(from: String, to: String, handler: Handler<AsyncResult<Void>>): FileSystem` Move a file from the path `from` to path `to`, asynchronously. The move will fail if the destination already exists. `open fun move(from: String, to: String, options: CopyOptions, handler: Handler<AsyncResult<Void>>): FileSystem` Move a file from the path `from` to path `to`, asynchronously.
moveBlocking | `open fun moveBlocking(from: String, to: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#move`
newInstance | `open static fun newInstance(arg: FileSystem): FileSystem`
open | `open fun open(path: String, options: OpenOptions, handler: Handler<AsyncResult<AsyncFile>>): FileSystem` Open the file represented by `path`, asynchronously. The file is opened for both reading and writing. If the file does not already exist it will be created.
openBlocking | `open fun openBlocking(path: String, options: OpenOptions): AsyncFile` Blocking version of `io.vertx.rxjava.core.file.FileSystem#open`
props | `open fun props(path: String, handler: Handler<AsyncResult<FileProps>>): FileSystem` Obtain properties for the file represented by `path`, asynchronously. If the file is a link, the link will be followed.
propsBlocking | `open fun propsBlocking(path: String): FileProps` Blocking version of `io.vertx.rxjava.core.file.FileSystem#props`
readDir | `open fun readDir(path: String, handler: Handler<AsyncResult<MutableList<String>>>): FileSystem` Read the contents of the directory specified by `path`, asynchronously. The result is an array of String representing the paths of the files inside the directory. `open fun readDir(path: String, filter: String, handler: Handler<AsyncResult<MutableList<String>>>): FileSystem` Read the contents of the directory specified by `path`, asynchronously. The parameter `filter` is a regular expression. If `filter` is specified then only the paths that match @{filter}will be returned. The result is an array of String representing the paths of the files inside the directory.
readDirBlocking | `open fun readDirBlocking(path: String): MutableList<String>` `open fun readDirBlocking(path: String, filter: String): MutableList<String>` Blocking version of `io.vertx.rxjava.core.file.FileSystem#readDir`
readFile | `open fun readFile(path: String, handler: Handler<AsyncResult<Buffer>>): FileSystem` Reads the entire file as represented by the path `path` as a , asynchronously. Do not use this method to read very large files or you risk running out of available RAM.
readFileBlocking | `open fun readFileBlocking(path: String): Buffer` Blocking version of `io.vertx.rxjava.core.file.FileSystem#readFile`
readSymlink | `open fun readSymlink(link: String, handler: Handler<AsyncResult<String>>): FileSystem` Returns the path representing the file that the symbolic link specified by `link` points to, asynchronously.
readSymlinkBlocking | `open fun readSymlinkBlocking(link: String): String` Blocking version of `io.vertx.rxjava.core.file.FileSystem#readSymlink`
rxChmod | `open fun rxChmod(path: String, perms: String): Single<Void>` Change the permissions on the file represented by `path` to `perms`, asynchronously. The permission String takes the form rwxr-x--- as specified here.
rxChmodRecursive | `open fun rxChmodRecursive(path: String, perms: String, dirPerms: String): Single<Void>` Change the permissions on the file represented by `path` to `perms`, asynchronously. The permission String takes the form rwxr-x--- as specified in {here}. If the file is directory then all contents will also have their permissions changed recursively. Any directory permissions will be set to `dirPerms`, whilst any normal file permissions will be set to `perms`.
rxChown | `open fun rxChown(path: String, user: String, group: String): Single<Void>` Change the ownership on the file represented by `path` to `user` and {code group}, asynchronously.
rxCopy | `open fun rxCopy(from: String, to: String): Single<Void>` Copy a file from the path `from` to path `to`, asynchronously. The copy will fail if the destination already exists. `open fun rxCopy(from: String, to: String, options: CopyOptions): Single<Void>` Copy a file from the path `from` to path `to`, asynchronously.
rxCopyRecursive | `open fun rxCopyRecursive(from: String, to: String, recursive: Boolean): Single<Void>` Copy a file from the path `from` to path `to`, asynchronously. If `recursive` is `true` and `from` represents a directory, then the directory and its contents will be copied recursively to the destination `to`. The copy will fail if the destination if the destination already exists.
rxCreateFile | `open fun rxCreateFile(path: String): Single<Void>` Creates an empty file with the specified `path`, asynchronously. `open fun rxCreateFile(path: String, perms: String): Single<Void>` Creates an empty file with the specified `path` and permissions `perms`, asynchronously.
rxDelete | `open fun rxDelete(path: String): Single<Void>` Deletes the file represented by the specified `path`, asynchronously.
rxDeleteRecursive | `open fun rxDeleteRecursive(path: String, recursive: Boolean): Single<Void>` Deletes the file represented by the specified `path`, asynchronously. If the path represents a directory and `recursive = true` then the directory and its contents will be deleted recursively.
rxExists | `open fun rxExists(path: String): Single<Boolean>` Determines whether the file as specified by the path `path` exists, asynchronously.
rxFsProps | `open fun rxFsProps(path: String): Single<FileSystemProps>` Returns properties of the file-system being used by the specified `path`, asynchronously.
rxLink | `open fun rxLink(link: String, existing: String): Single<Void>` Create a hard link on the file system from `link` to `existing`, asynchronously.
rxLprops | `open fun rxLprops(path: String): Single<FileProps>` Obtain properties for the link represented by `path`, asynchronously. The link will not be followed.
rxMkdir | `open fun rxMkdir(path: String): Single<Void>` Create the directory represented by `path`, asynchronously. The operation will fail if the directory already exists. `open fun rxMkdir(path: String, perms: String): Single<Void>` Create the directory represented by `path`, asynchronously. The new directory will be created with permissions as specified by `perms`. The permission String takes the form rwxr-x--- as specified in here. The operation will fail if the directory already exists.
rxMkdirs | `open fun rxMkdirs(path: String): Single<Void>` Create the directory represented by `path` and any non existent parents, asynchronously. The operation will fail if the directory already exists. `open fun rxMkdirs(path: String, perms: String): Single<Void>` Create the directory represented by `path` and any non existent parents, asynchronously. The new directory will be created with permissions as specified by `perms`. The permission String takes the form rwxr-x--- as specified in here. The operation will fail if the directory already exists.
rxMove | `open fun rxMove(from: String, to: String): Single<Void>` Move a file from the path `from` to path `to`, asynchronously. The move will fail if the destination already exists. `open fun rxMove(from: String, to: String, options: CopyOptions): Single<Void>` Move a file from the path `from` to path `to`, asynchronously.
rxOpen | `open fun rxOpen(path: String, options: OpenOptions): Single<AsyncFile>` Open the file represented by `path`, asynchronously. The file is opened for both reading and writing. If the file does not already exist it will be created.
rxProps | `open fun rxProps(path: String): Single<FileProps>` Obtain properties for the file represented by `path`, asynchronously. If the file is a link, the link will be followed.
rxReadDir | `open fun rxReadDir(path: String): Single<MutableList<String>>` Read the contents of the directory specified by `path`, asynchronously. The result is an array of String representing the paths of the files inside the directory. `open fun rxReadDir(path: String, filter: String): Single<MutableList<String>>` Read the contents of the directory specified by `path`, asynchronously. The parameter `filter` is a regular expression. If `filter` is specified then only the paths that match @{filter}will be returned. The result is an array of String representing the paths of the files inside the directory.
rxReadFile | `open fun rxReadFile(path: String): Single<Buffer>` Reads the entire file as represented by the path `path` as a , asynchronously. Do not use this method to read very large files or you risk running out of available RAM.
rxReadSymlink | `open fun rxReadSymlink(link: String): Single<String>` Returns the path representing the file that the symbolic link specified by `link` points to, asynchronously.
rxSymlink | `open fun rxSymlink(link: String, existing: String): Single<Void>` Create a symbolic link on the file system from `link` to `existing`, asynchronously.
rxTruncate | `open fun rxTruncate(path: String, len: Long): Single<Void>` Truncate the file represented by `path` to length `len` in bytes, asynchronously. The operation will fail if the file does not exist or `len` is less than `zero`.
rxUnlink | `open fun rxUnlink(link: String): Single<Void>` Unlinks the link on the file system represented by the path `link`, asynchronously.
rxWriteFile | `open fun rxWriteFile(path: String, data: Buffer): Single<Void>` Creates the file, and writes the specified `Buffer data` to the file represented by the path `path`, asynchronously.
symlink | `open fun symlink(link: String, existing: String, handler: Handler<AsyncResult<Void>>): FileSystem` Create a symbolic link on the file system from `link` to `existing`, asynchronously.
symlinkBlocking | `open fun symlinkBlocking(link: String, existing: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#link`
toString | `open fun toString(): String`
truncate | `open fun truncate(path: String, len: Long, handler: Handler<AsyncResult<Void>>): FileSystem` Truncate the file represented by `path` to length `len` in bytes, asynchronously. The operation will fail if the file does not exist or `len` is less than `zero`.
truncateBlocking | `open fun truncateBlocking(path: String, len: Long): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#truncate`
unlink | `open fun unlink(link: String, handler: Handler<AsyncResult<Void>>): FileSystem` Unlinks the link on the file system represented by the path `link`, asynchronously.
unlinkBlocking | `open fun unlinkBlocking(link: String): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#unlink`
writeFile | `open fun writeFile(path: String, data: Buffer, handler: Handler<AsyncResult<Void>>): FileSystem` Creates the file, and writes the specified `Buffer data` to the file represented by the path `path`, asynchronously.
writeFileBlocking | `open fun writeFileBlocking(path: String, data: Buffer): FileSystem` Blocking version of `io.vertx.rxjava.core.file.FileSystem#writeFile`