Work with files / Basic operations

let fileManager = FileManager.default

let dir = fileManager.urls(
    for: .documentDirectory,
    in: .userDomainMask).first!
let url = dir.appendingPathComponent("file.txt")

let exists = fileManager.fileExists(atPath: url.path)
print(exists)