[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:58:08 UTC 2019


On Friday, 2019-04-12 11:50:11 -0400, Marek Olšák wrote:
> On Fri, Apr 12, 2019 at 11:41 AM Eric Engestrom <eric.engestrom at intel.com>
> wrote:
> 
> > 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)` ?
> >
> 
> That's not standard C API.

Right, that's POSIX and that can't be used on windows, which this file
can be built on.
My bad :)


More information about the mesa-dev mailing list