Nim 检查文件是否存在

Ale*_*urt -2 nim-lang

如何检查 Nim 中是否存在文件?
一个简单的问题,在官方文档中可能会太长!
我希望有人能在这里问这个问题。

Ale*_*urt 5

import os
import std/strformat

if fileExists(path):
  echo &"path {path} exists!"
Run Code Online (Sandbox Code Playgroud)