Check if file exists + ulp :S

Hi all!

I know that this may not be the best forum to ask ulp and eagle related question. But the guys from eagle didn't know the answer and this is the BEST programming forum I know :smiley:

How can I check if a file exists while programming eagle's ulp's?

There is not much information on-line.

Thank you!

I guess you are trying to find whether a file is exist or not using C.
If I am right :
The following is your solution

int file_exists(const char * filename)
{
    if (FILE * file = fopen(filename, "r"))
    {
        fclose(file);
        return 1;
    }
    return 0;
}

I'm sorry...I totally forgot to close this thread..the function is filegrob and I found this almost one week ago..but then I forgot to close this thread.

Thanks anyway