dafky2000 / simplectemplate

Simple C Template library to expand placeholders in a template string, simple alternative to mustache.github.io that doesn't require JSON as data input.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove `exists` function

dafky2000 opened this issue · comments

As per @andy5995's comment, we should be able to do without the exists function
82ab97f#commitcomment-25148134

int exists(const char* filename) {

I was thinking... you may want to consider checking for file existence with fopen(), unless there's a good reason not to. More minimal... I don't remember exactly, but I think the only reason I went with lstat() is because I originally used it in code where I was checking for directories, as well as files. I don't think you can use fopen() to accurately check if a directory exists. Since it's not a regular file, it always returns an error... I forget some specifics, so don't quote me on that!

Fixed via #45