[Mesa-dev] [PATCH] mesa: don't overwrite existing shader files with MESA_SHADER_CAPTURE_PATH

Eric Engestrom eric.engestrom at intel.com
Fri Apr 12 15:41:30 UTC 2019


On Friday, 2019-04-12 11:00:56 -0400, Marek Olšák wrote:
> On Thu, Apr 11, 2019 at 2:53 AM Tapani Pälli <tapani.palli at intel.com> wrote:
> > On 4/11/19 3:32 AM, Marek Olšák wrote:
> > > -      file = fopen(filename, "w");
> > > +         }
> > > +         FILE *file = fopen(filename, "r");
> > > +         if (!file)
> > > +            break;
> >
> > I'm surprised we don't have some helper like 'util_path_exists' but this
> > works, I guess then we should have 'util_path_isdir|isfile' and others
> > as well.
> >
> 
> There is no standard API for checking whether a file exists. fopen is the
> only standard way to do it.

What about `access(filename, F_OK)` ?


More information about the mesa-dev mailing list