Alexandre Daubricourt
Alexandre Daubricourt

Reputation: 4913

Nim check if file exists

How to check if a file exists in Nim?
A simple question that might be too long to look for in the official documentation!
I wish someone would have asked that question here.

Upvotes: -2

Views: 907

Answers (1)

Alexandre Daubricourt
Alexandre Daubricourt

Reputation: 4913

import os
import std/strformat

if fileExists(path):
  echo &"path {path} exists!"

Upvotes: 5

Related Questions