Skip to content
← Back to Community
How to check if a file exists
Profile icon
JacobMcPherson1

How am I able to check if a file already exists in the repl

Voters
Profile icon
JohnnySantamari
Profile icon
SumitBhutta
Profile icon
KelvinFernandez
Profile icon
ddaenishh
Profile icon
JacobMcPherson1
Comments
hotnewtop
Profile icon
btfuss

Use the system() function is the c++ access to the bash commands. Then refer to this article: https://linuxize.com/post/bash-check-if-file-exists/

Good luck!

Profile icon
JacobMcPherson1

@2plus2is4hoi I found out a way to do it right before you commented. Sorry lol