Course of Raku / Objects, I/O, and exceptions / Input and output / Working with directories / Exercises

Does it exist?

Problem

Before creating anything, print whether a file called test.txt exists. Then create it, and print whether it exists now. The same path should report False first and True afterwards.

Example

The program prints:

False
True

Solution

See the solution

Course navigation

Quiz — File tests   |   Solution: Does it exist?