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

Marek Olšák maraeo at gmail.com
Fri Apr 12 15:50:11 UTC 2019


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.

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190412/ef28efd8/attachment-0001.html>


More information about the mesa-dev mailing list