> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/r/read_entire_file.md).

# Read entire file

Reading an entire file as a string, can be achieved with the *FileHandle.slurp()* method, as illustrated bellow:

```ruby
var file = File(__FILE__)
var content = file.open_r.slurp
print content
```

Starting with version 2.30, *File.read()* can do the same:

```ruby
var file = File(__FILE__)
var content = file.read(:utf8)
print content
```
