<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 12, 2019 at 11:41 AM Eric Engestrom <<a href="mailto:eric.engestrom@intel.com">eric.engestrom@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Friday, 2019-04-12 11:00:56 -0400, Marek Olšák wrote:<br>
> On Thu, Apr 11, 2019 at 2:53 AM Tapani Pälli <<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a>> wrote:<br>
> > On 4/11/19 3:32 AM, Marek Olšák wrote:<br>
> > > - file = fopen(filename, "w");<br>
> > > + }<br>
> > > + FILE *file = fopen(filename, "r");<br>
> > > + if (!file)<br>
> > > + break;<br>
> ><br>
> > I'm surprised we don't have some helper like 'util_path_exists' but this<br>
> > works, I guess then we should have 'util_path_isdir|isfile' and others<br>
> > as well.<br>
> ><br>
> <br>
> There is no standard API for checking whether a file exists. fopen is the<br>
> only standard way to do it.<br>
<br>
What about `access(filename, F_OK)` ?<br></blockquote><div><br></div><div>That's not standard C API.</div><div><br></div><div>Marek<br></div></div></div>