View Source Reactor.File
An extension which provides steps for working with the local filesystem within Reactor.
reactor.chgrp
chgrp nameChange the group of a file or directory.
Uses File.chgrp/2 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the file or directory | |
gid | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The GID to set the file group to | |
description | String.t | An optional description for the step | |
revert_on_undo? | boolean | false | Change the GID back to the original value on undo? |
reactor.chgrp.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Chgrp
reactor.chown
chown nameChange the owner of a file or directory.
Uses File.chown/2 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the file or directory | |
uid | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The UID to set the file owner to | |
description | String.t | An optional description for the step | |
revert_on_undo? | boolean | false | Change the UID back to the original value on undo? |
reactor.chown.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Chown
reactor.chmod
chmod nameChange the permissions of a file or directory.
Uses File.chmod/2 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the file or directory | |
mode | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The mode to set the file permissions to | |
description | String.t | An optional description for the step | |
revert_on_undo? | boolean | false | Change the permissions back to the original value on undo? |
reactor.chmod.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Chmod
reactor.cp
cp nameCopy the source file to the destination.
Uses File.cp/2 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
source | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the source file | |
target | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the target file | |
description | String.t | An optional description for the step | |
overwrite? | boolean | true | Whether or not to overwrite the target if it already exists |
revert_on_undo? | boolean | false | Revert back to the initial state on undo (either by removing the target or by setting it back to it's original content) |
reactor.cp.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Cp
reactor.cp_r
cp_r nameCopy the source file or directories to the destination.
Uses File.cp_r/2 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
source | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the source file | |
target | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the target file | |
description | String.t | An optional description for the step | |
overwrite? | boolean | true | Whether or not to overwrite the target if it already exists |
revert_on_undo? | boolean | false | Revert back to the initial state on undo (either by removing the target or by setting it back to it's original content) |
reactor.cp_r.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.CpR
reactor.glob
glob nameSearches for files matching the provided pattern.
Uses Path.wildcard/2 under the hood.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
pattern | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | A pattern used to select files. See Path.wildcard/2 for more information. | |
description | String.t | An optional description for the step | |
match_dot | boolean | false | Whether or not files starting with a . will be matched by the pattern. See Path.wildcard/2 for more information. |
reactor.glob.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Glob
reactor.ln
ln nameCreate a hard link from existing to new.
Uses File.ln/2 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
existing | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the existing file | |
new | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the new file | |
description | String.t | An optional description for the step | |
overwrite? | boolean | true | Whether or not to overwrite the new if it already exists |
revert_on_undo? | boolean | false | Revert back to the initial state on undo (either by removing the new or by setting it back to it's original content) |
reactor.ln.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Ln
reactor.ln_s
ln_s nameCreate a symbolic link from existing to new.
Uses File.ln_s/2 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
existing | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the existing file | |
new | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the new file | |
description | String.t | An optional description for the step | |
overwrite? | boolean | true | Whether or not to overwrite the new if it already exists |
revert_on_undo? | boolean | false | Revert back to the initial state on undo (either by removing the new or by setting it back to it's original content) |
reactor.ln_s.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.LnS
reactor.lstat
lstat nameReturns information about a path.
If the file is a symlink, sets the type to :symlink and returns a
File.Stat struct for the link. For any other file, returns exactly the
same values as stat.
See File.lstat/2 for more information.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path of the directory to create | |
description | String.t | An optional description for the step | |
time | :universal | :local | :posix | :posix | What format to return the file times in. See File.stat/2 for more. |
reactor.lstat.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Lstat
reactor.mkdir
mkdir nameCreates a directory.
Uses File.mkdir/1 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path of the directory to create | |
description | String.t | An optional description for the step | |
remove_on_undo? | boolean | false | Remove the created directory if the Reactor is undoing changes |
reactor.mkdir.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Mkdir
reactor.mkdir_p
mkdir_p nameCreates a directory and any intermediate directories which also must be created.
Uses File.mkdir_p/1 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path of the directory to create | |
description | String.t | An optional description for the step | |
remove_on_undo? | boolean | false | Remove the created directory if the Reactor is undoing changes |
reactor.mkdir_p.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.MkdirP
reactor.read_link
read_link nameReads a symbolic link.
Uses File.read_link/1 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path to the link to read | |
description | String.t | An optional description for the step |
reactor.read_link.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.ReadLink
reactor.rmdir
rmdir nameRemoves a directory.
Uses File.rmdir/1 behind the scenes.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path of the directory to remove | |
description | String.t | An optional description for the step | |
recreate_on_undo? | boolean | false | Recreate the directory if the Reactor is undoing changes |
reactor.rmdir.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Rmdir
reactor.stat
stat nameReturns information about a path.
See File.stat/2 for more information.
Nested DSLs
Arguments
| Name | Type | Default | Docs |
|---|---|---|---|
name | atom | A unique name for the step. Used when choosing the return value of the Reactor and for arguments into other steps |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
path | Reactor.Template.Element | Reactor.Template.Input | Reactor.Template.Result | Reactor.Template.Value | The path of the directory to create | |
description | String.t | An optional description for the step | |
time | :universal | :local | :posix | :posix | What format to return the file times in. See File.stat/2 for more. |
reactor.stat.wait_for
wait_for namesWait for the named step to complete before allowing this one to start.
Desugars to argument :_, result(step_to_wait_for)
Examples
wait_for :create_userArguments
| Name | Type | Default | Docs |
|---|---|---|---|
names | atom | list(atom) | The name of the step to wait for. |
Options
| Name | Type | Default | Docs |
|---|---|---|---|
description | String.t | An optional description. |
Introspection
Target: Reactor.Dsl.WaitFor
Introspection
Target: Reactor.File.Dsl.Stat