# text2file proc

Source: https://ref.dm-lang.org/proc/text2file

### Format
> `text2file(Text,File)`

### Args
- `Text`: text to be added to file
- `File`: file to be appended to


### Returns
> 1 on success; 0 otherwise.

Appends text to a file. If the file does not exist, one will be created.

This can be useful when interacting with external applications that read output from a text file. For example, you might have an external program that mimics conversation:

```dm /text2file/
mob/oracle/verb/tell(T as text)
  text2file(T,"oracle.in")
  shell("oracle < oracle.in > oracle.out")
  usr << file2text("oracle.out")
```

### See also
- [file2text proc](https://ref.dm-lang.org/proc/file2text.md)
- [shell proc](https://ref.dm-lang.org/proc/shell.md)
