Course of Raku / Objects, I/O, and exceptions / Input and output / Working with directories / Exercises
File or directory?
Problem
Create a file called a.txt. Then ask the same
path two questions: is it a regular file (.f), and is it a
directory (.d)? Print both answers, to see that the two
tests give opposite results for one path.
Example
The program prints:
True
FalseSolution
Course navigation
← Solution: Make a directory | Solution: File or directory? →